1.0.0 • Published 9 years ago
rulify v1.0.0
Rulify
Convert .rule files into .fst files.
Node Usage
Rulify takes two arguments, the first is the path to the RULE file, the second is the callback when complete.
const rulify = require('rulify');
rulify('main.rule', function(err, output) {
  // output is the path to the output file
});Specify Output
An optional second argument can be the output path for the FST file.
rulify('src/main.rule', 'rules/main.fst', function(err, output) {
  // file is saved
});Sync
There's an option to run rulify synchronously.
rulify.sync('src/main.rule', 'rules/main.fst');Commandline
Installing rulify globally (npm install -g rulify) will allow you to batch convert rule files to fst files.
Convert to FST
Convert a single file. Must specify the output directory (either -o or --output).
rulify -o rules src/main.rule Multiple files
Use the -o or --output argument to specify an output directory.
rulify --output rules src/*.rulerulify -o rules src/*.ruleConvert Directory
Use the -i or --input argument to specify an input directory of files.
rulify --output rules --input srcrulify -o rules -i src1.0.0
9 years ago