stdin-transform-cli

1.0.4 • Public • Published

Create a simple command-line interface for any string-to-string transformation.

$ npm install --save stdin-transform-cli

If your transformation is a synchronous function of the form module.exports = function(string) { }, add the following to your package.json:

{ "bin": "node_modules/stdin-transform-cli/sync" }

If your transformation is an asynchronous function of the form module.exports = function(string, errorFirstCallback) { }:

{ "bin": "node_modules/stdin-transform-cli/async" }

Otherwise, create your own bin script using the JavaScript API:

#!/usr/bin/env node
require('stdin-transform-cli')(
  require('./package/json'),
  function(input, callback) {
    // Require and apply your transformation, then invoke
    callback(error, result) })()

Package Sidebar

Install

npm i stdin-transform-cli

Weekly Downloads

2

Version

1.0.4

License

MIT

Last publish

Collaborators

  • kemitchell