node package manager
We need your input. Help make JavaScript better: Take the 2017 JavaScript Ecosystem survey »

stupid-dictionary

stupid-dictionary

This is a word replacer. It reads the words to replace from a dictionary, replaces the words in the file you want to, and then outputs the results to stdout.

The dictionary must be a valid json file.

You must provide a file from which the contents will be read with --to-replace [path]. There is also --dictionary if you don't want to use the default ./dictionary.json path.

Usage

$ npm install -g stupid-dictionary
(...)
$ ls
dictionary.json nasa.txt
$ cat dictionary.json
{ "google glass": "virtual boy", "space": "spaaace" }
$ cat nasa.txt
NASA is looking into using Google Glass to assist astrounatus working in space.
$ stupid-dictionary --to-replace nasa.txt
NASA is looking into using Virtual Boy to assist astrounauts working in spaaace.