resource-tag

0.4.2 • Public • Published

tag

a simple hierarchical tagging system

API

properties

methods

properties

a simple hierarchical tagging system

  • id

    • type : any
  • name

    • type : string

    • description : the name of the tag

    • required : true

  • parentID

    • type : string

    • description : the parent ID of the tag

    • key : tag

    • default :

methods

tag.create(options, callback)

create a new tag

  • options

    • type : object

    • properties

      • id

        • type : any
      • name

        • type : string

        • description : the name of the tag

        • required : true

      • parentID

        • type : string

        • description : the parent ID of the tag

        • key : tag

        • default :

  • callback

    • type : function

tag.get(id, callback)

get tag by id

  • id

    • type : any

    • description : the id of the object

    • required : true

  • callback

    • type : function

tag.find(options, callback)

search for instances of tag

  • options

    • type : object

    • properties

      • id

        • type : any

        • default :

        • required : false

      • name

        • type : any

        • description : the name of the tag

        • required : false

        • default :

      • parentID

        • type : any

        • description : the parent ID of the tag

        • key : tag

        • default :

        • required : false

  • callback

    • type : function

tag.all(callback)

gets all instances of tag

  • callback

    • type : function

tag.update(options, callback)

updates a tag by id

  • options

    • type : object

    • properties

      • id

        • type : any
      • name

        • type : string

        • description : the name of the tag

        • required : true

      • parentID

        • type : string

        • description : the parent ID of the tag

        • key : tag

        • default :

  • callback

    • type : function

tag.updateOrCreate(options, callback)

updates a tag by id, and creates if necessary

  • options

    • type : object

    • properties

      • id

        • type : any
      • name

        • type : string

        • description : the name of the tag

        • required : true

      • parentID

        • type : string

        • description : the parent ID of the tag

        • key : tag

        • default :

  • callback

    • type : function

tag.destroy(id, callback)

destroys a tag by id

  • id

    • type : string

    • description : the id of the object

    • required : true

  • callback

    • type : function

tag.createTag(options)

  • options

    • type : object

    • properties

      • name

        • type : string

        • description : the name of the tag

        • required : true

      • parentID

        • type : string

        • description : the parent ID of the tag

        • key : tag

        • default :

tag.getTag(options)

  • options

    • type : object

    • properties

      • id

        • type : string

        • description : the name of the tag

        • required : true

README auto-generated with docs

Readme

Keywords

none

Package Sidebar

Install

npm i resource-tag

Weekly Downloads

0

Version

0.4.2

License

none

Last publish

Collaborators

  • marak