1.0.6 • Published 6 years ago

bobbotag v1.0.6

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

Bobbotag

A simple node module to detect and manage tags on input strings.

Usage

const Bobbotag = require('bobbotag')

let users = {
  foo: {
    value: '12',
    label: 'Foo Bar'
  },
  bar: {
    value: '42',
    label: 'Bar Foo'
  }
}

let text = ''

const bobbo = new Bobbotag({
  tag: '@',
  tagReplaced: '#@#'
})

function onChangeText(newText) {
  bobbo.changeText(newText)

  if (bobbo.getCurrentTag() && users[bobbo.getCurrentTag()]) {
    bobbo.replaceCurrentTag(
      users[bobbo.getCurrentTag()]
    )
  }

  text = bobbo.getPrettyText()
}

function onSubmit() {
  console.log('Pretty:', bobbo.getPrettyText())
  console.log('Real:', bobbo.getText())
  console.log('Tags:', bobbo.getTags())
}

TODO

  • Write a better documentation.
1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago