Skip to content
Functions that assist in working with strings. Node.js
CoffeeScript JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
src Use latest super & lingo
test Update to latest mocha and should
.gitignore Removing lib from the gitignore file
.travis.yml Migrate to hydro entirely
Makefile Start using hydro Cleanup
hydro.conf.js Migrate to hydro entirely
package.json Use latest super & lingo

Build Status




Word contains functions that assist in working with strings.


  • strip slashes
  • strip quotes
  • quotes to entities
  • random strings
  • repeat string
  • censor words in text
  • strip links
  • auto links
  • excerpts
  • word limit
  • pluralize
  • join
  • capitalize
  • camel-case
  • slug
word = require 'word'

result = null

result = word.stripSlashes "O\\'reilly" # strips slashes.

result = word.stripQuotes "foo ' bar" # strips quotes

result = word.quotesEntities "foo ' bar" # quotes to entities

result = word.random 5 # returns random string with length of 5

result = word.repeat 'foo', 3 # repeats n times a string

result = word.censor 'foo', 'foo', '***' # censors bad words.

result = word.censor 'foo bar baz', ['foo', 'bar'], '***'

result = word.stripLinks 'baz <a href="" class="foobar">Foo</a>' # strips links

result = word.autoLink "" # links -> a + href

result = word.excerpt 'foobar', 3 # extracts an excerpt from string

result = word.limit 'foo bar baz bar foo.', 3 # limits text to n words.

result = word.wrap 'foooo bar baz', 3 # wraps text to given length.

result = word.pluralize 2, 'dog' # pluralize or not, depends on supplied count.

Want to use it as helper in your express app? Sure.


$ npm install word


$ npm install
$ make test


MIT License

Something went wrong with that request. Please try again.