Skip to content

Galvesmash/fortunes-list

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fortunes-list

This forks of jimkang's fortune-tweetable that forks of williamfligor's fortune also makes the content of the old fortune Unix command available to Node programs, with the following changes:

  • All of the fortunes under fortunes/off and a few other fortune files that had similar "Truly Tasteless Jokes"-type content. Don't worry – there's probably still plenty of cringeworthy crotchety uncle stuff left in there.

  • convert.js, which converts the fortunes to JSON has been modified to omit any fortune over 140 characters.

  • Added "keys()" to get all fortune topics.

  • Added "key" prop to "fortune()" to get all specific topic fortune.

Installation

npm install fortunes-list

This will run the postinstall script from package.json. If you modify the contents of the fortunes directory run npm run-script postinstall to rebuild the JSON files that the module uses to get fortunes.

Usage

const fortunes = require('fortunes-list')
console.log(fortunes.keys())
console.log(fortunes.fortune())
console.log(fortunes.fortune('art'))

Tests

npm test

License

ISC.

About

Fortune for Node.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%