Meet npm Pro: unlimited public & private packages + package-based permissions.Learn more »

dogeify-js

1.2.0 • Public • Published

Dogeify.js

Build Status Dependency Status

A Node module that converts everyday English into doge. This is the JavaScript version of the Dogeify Ruby gem.

Installation

Yarn:

yarn add dogeify-js

npm:

npm i dogeify-js

Usage

You can use this module in your Node project or the CLI.

Usage in a Node project:

const dogeify = require('dogeify-js');
 
const str = 'The quick brown fox jumps over the lazy dog. A cat is walking on the street';
console.log(await dogeify(str)); // very fox. very brown. such doge. amaze. many cat. so street. wow.

You can also pass an array to convert to doge:

const arr = [
  'The quick brown fox jumps over the lazy dog.',
  'A cat is walking on the street.'
];
console.log(await dogeify.array(arr));
/* Returns:
  [
    'much brown. very fox. such doge. excite.',
    'so cat. very street. amaze.
  ]
*/

You can provide an array of words to exclude from the output:

console.log(await dogeify('I\'ve seen a dog and a cat.', {
  ignore: [ 'cat' ]
}));
// such doge. wow.

Usage in the CLI:

> dogeify The quick brown fox jumps over the lazy dog.
very brown. such fox. much doge. amaze.

Will there ever be a browser version? Maybe in the future, if there will be interest.

Contribution

Contribution is always welcome! Before submitting your pull request, make sure to create the appropriate unit tests and run them:

yarn test
# or
npm run test

Also make sure that your changes pass linting:

yarn lint
# or
npm run lint

License

MIT.

Install

npm i dogeify-js

DownloadsWeekly Downloads

8

Version

1.2.0

License

MIT

Unpacked Size

55.6 kB

Total Files

10

Last publish

Collaborators

  • avatar