1.0.0 • Published 10 years ago

more-text v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

more-text

NPM version Build status

more text for node

Installation

$ npm install more-text

Example

moreText(2, [1, 5], function(err, data) {
    console.log(data)
});

data may looks like:

{ sentences: [ '什麼?', '天下無敵。' ] }

Usage

moreText(n, limit, callback)
  • n: how many sentences you need.
  • limit(array/string/number): limit the words number of each sentence.
    • if array has two elements, all the sentences' word number will between first element and the second element.
    • if there is only one element, it indicate the maxium number of words.
    • you can also pass an string or number to assign the limit:
      • 1
      • '1,10'
      • '5'
  • callback(err, result): callback will be passed two arguments:
    • err: error cataching
    • result: the response

License

MIT © Leigh Zhu