{"_id":"crun","_rev":"26-725d4675f99215ac35c0dd1c061e66a2","name":"crun","description":"Generates JavaScript functions mapped to system commands","dist-tags":{"latest":"0.1.1"},"versions":{"0.0.1":{"name":"crun","version":"0.0.1","description":"Generates JavaScript functions mapped to system commands","main":"lib/crun.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["command-line","runner","cli"],"author":{"name":"Sean Lao"},"license":"BSD","readme":"ERROR: No README data found!","_id":"crun@0.0.1","dist":{"shasum":"3485aabc5c67577eebcf743071847265589ac242","tarball":"https://registry.npmjs.org/crun/-/crun-0.0.1.tgz","integrity":"sha512-zLqnFcQRBTpnWy/NIxuGejH8iU59kyph7y5nFJbUevPXbmw3zi1lxbkzlN6FmQtRIWfXSXi3B7pBxdr201pFSw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCXLWTz+sojIK6JtoR8TDihxyA+BgJQpXp6CCnaWyOgOgIgNOlwVA6Q4UqrdwZNwo5GbMp0jrx8Lb21Oaxld8f/BQY="}]},"_from":".","_npmVersion":"1.3.3","_npmUser":{"name":"slao","email":"slao258@gmail.com"},"maintainers":[{"name":"slao","email":"slao258@gmail.com"}]},"0.0.2":{"name":"crun","description":"Generates JavaScript functions mapped to system commands","main":"./lib/crun.js","author":{"name":"Sean Lao"},"version":"0.0.2","repository":{"type":"git","url":"https://github.com/slao/crun.git"},"bugs":{"url":"https://github.com/slao/crun/issues"},"scripts":{"test":"mocha"},"devDependencies":{"expect.js":"*","mocha":"*"},"keywords":["command-line","runner","cli"],"license":"BSD","readme":"# Crun.js\n\nCrun is a Node.js module which provides methods to map system commands to JavaScript functions, to allow better reusability of system command calls. Function parameters represent argument strings which are interpolated via #{…} symbols with arbitrary names.\n\nChildProcess object is returned when calling commands without providing a callback function. If a callback function is provided, there is no return value and the results are processed through the callback.\n\n## Example\n\n```javascript\nvar crun = require('crun');\n\n// generate commands\nvar commands = {\n\tls: 'ls -al',\n\tcp: 'cp -Rf #{src} #{dst}',\n\ttail: 'tail -f #{log}'\n};\ncrun.generate('test', commands);\n\n// run commands child_process.exec\ncrun.test.ls(function(error, result) {\n\tconsole.log('ls output: ' + result.stdout);\n});\n\ncrun.test.cp('file1', 'file2', function (error, result) {\n\tconsole.log('cp output: ' + result.stdout);\n});\n\n//run commands child_process.spawn\nvar tail = crun.test.tail('logfile');\ntail.stdout.on('data', function (data) {\n  console.log('stdout: ' + data);\n});\n\ntail.stderr.on('data', function (data) {\n  console.log('stderr: ' + data);\n});\n\ntail.on('close', function (code) {\n  console.log('child process exited with code ' + code);\n});\n\n","readmeFilename":"README.md","_id":"crun@0.0.2","dist":{"shasum":"90bf9cb0ace719a486902752814829f3d727e26e","tarball":"https://registry.npmjs.org/crun/-/crun-0.0.2.tgz","integrity":"sha512-gw6Trc4dwIUN8og2DGZsKDm/139Sglkaa1SqjNPh82tnTD0i1zY7vA5R8dIbv04w7znPBX/jFtEmBrcaGXOe7w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDCKrGUwI9Kuy8eWBn7BDNG4oUzfZYuUPwYMdOVle4GCQIhAO669vxunng0NW/0YqqrQ92SFFL2VSpCUfBEH6Raugc1"}]},"_from":".","_npmVersion":"1.3.3","_npmUser":{"name":"slao","email":"slao258@gmail.com"},"maintainers":[{"name":"slao","email":"slao258@gmail.com"}]},"0.0.3":{"name":"crun","description":"Generates JavaScript functions mapped to system commands","main":"./lib/crun.js","author":{"name":"Sean Lao"},"version":"0.0.3","repository":{"type":"git","url":"https://github.com/slao/crun.git"},"bugs":{"url":"https://github.com/slao/crun/issues"},"scripts":{"test":"mocha"},"devDependencies":{"expect.js":"*","mocha":"*"},"keywords":["command-line","runner","cli"],"license":"BSD","readme":"# Crun.js\n\nCrun is a Node.js module which provides methods to map system commands to JavaScript functions, to allow better reusability of system command calls. Function parameters represent argument strings which are interpolated via #{…} symbols with arbitrary names.\n\nChildProcess object is returned when calling commands without providing a callback function. If a callback function is provided, there is no return value and the results are processed through the callback.\n\n## Example\n\n```javascript\nvar crun = require('crun');\n\n// generate commands\nvar commands = {\n\tls: 'ls -al',\n\tcp: 'cp -Rf #{src} #{dst}',\n\ttail: 'tail -f #{log}'\n};\ncrun.generate('test', commands);\n\n// run commands child_process.exec\ncrun.test.ls(function(error, result) {\n\tconsole.log('ls output: ' + result.stdout);\n});\n\ncrun.test.cp('file1', 'file2', function (error, result) {\n\tconsole.log('cp output: ' + result.stdout);\n});\n\n//run commands child_process.spawn\nvar tail = crun.test.tail('logfile');\ntail.stdout.on('data', function (data) {\n  console.log('stdout: ' + data);\n});\n\ntail.stderr.on('data', function (data) {\n  console.log('stderr: ' + data);\n});\n\ntail.on('close', function (code) {\n  console.log('child process exited with code ' + code);\n});\n```\n","readmeFilename":"README.md","_id":"crun@0.0.3","dist":{"shasum":"14ecdba9e9240ae9581999e0d6fcc944ac06f7c7","tarball":"https://registry.npmjs.org/crun/-/crun-0.0.3.tgz","integrity":"sha512-yc5l9qzXuN+55WWKnforoPKZIHpGn/gFk+tNooVz4In+AjB+raxi6/qMTnMwezl6BqWfBX4YDyWIf5SfIheN1A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFysJL3PkY3dkXmWPajCXS3Qu7YaVpaSClmIgWOJ2NnwAiAcW0oS1SYrTeJa74Iv4IgEvTPOIt9G/rHrmlHGTHj0yA=="}]},"_from":".","_npmVersion":"1.3.3","_npmUser":{"name":"slao","email":"slao258@gmail.com"},"maintainers":[{"name":"slao","email":"slao258@gmail.com"}]},"0.0.4":{"name":"crun","description":"Generates JavaScript functions mapped to system commands","main":"./lib/crun.js","author":{"name":"Sean Lao"},"version":"0.0.4","repository":{"type":"git","url":"https://github.com/slao/crun.git"},"bugs":{"url":"https://github.com/slao/crun/issues"},"scripts":{"test":"mocha"},"devDependencies":{"expect.js":"*","mocha":"*"},"keywords":["command-line","runner","cli"],"license":"BSD","readme":"# Crun.js\n\nCrun is a Node.js module which provides methods to map system commands to JavaScript functions, to allow better reusability of system command calls. Function parameters represent argument strings which are interpolated via #{…} symbols with arbitrary names.\n\nChildProcess object is returned when calling commands without providing a callback function. If a callback function is provided, there is no return value and the results are processed through the callback.\n\n## Install\n\nInstall the module with: `npm install crun`\n\n## Example\n\n```javascript\nvar crun = require('crun');\n\n// generate commands\nvar commands = {\n\tls: 'ls -al',\n\tcp: 'cp -Rf #{src} #{dst}',\n\ttail: 'tail -f #{log}'\n};\ncrun.generate('test', commands);\n\n// run commands child_process.exec\ncrun.test.ls(function(error, result) {\n\tconsole.log('ls output: ' + result.stdout);\n});\n\ncrun.test.cp('file1', 'file2', function (error, result) {\n\tconsole.log('cp output: ' + result.stdout);\n});\n\n//run commands child_process.spawn\nvar tail = crun.test.tail('logfile');\ntail.stdout.on('data', function (data) {\n  console.log('stdout: ' + data);\n});\n\ntail.stderr.on('data', function (data) {\n  console.log('stderr: ' + data);\n});\n\ntail.on('close', function (code) {\n  console.log('child process exited with code ' + code);\n});\n```\n","readmeFilename":"README.md","_id":"crun@0.0.4","dist":{"shasum":"4a0210dccefc472b0b46cfec0f336795d70fca50","tarball":"https://registry.npmjs.org/crun/-/crun-0.0.4.tgz","integrity":"sha512-3+D/8jezQG0lDMk1CRQ+0VSJLfJvDUUTYefAu+dxJVzwHGq02wVs3XBeEJkXkrTEmXNuoQbzNX6lVu75wWNQNQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDWea710vcR5zGL06KQ7rdpLzBRopeUISzLi5A+omV+HgIhAJcy0O1H7BtdPI7F2zatgVahXaOSGMH0/dHgivPcuLhW"}]},"_from":".","_npmVersion":"1.3.3","_npmUser":{"name":"slao","email":"slao258@gmail.com"},"maintainers":[{"name":"slao","email":"slao258@gmail.com"}]},"0.0.5":{"name":"crun","description":"Generates JavaScript functions mapped to system commands","main":"./lib/crun.js","author":{"name":"Sean Lao"},"version":"0.0.5","repository":{"type":"git","url":"https://github.com/slao/crun.git"},"bugs":{"url":"https://github.com/slao/crun/issues"},"scripts":{"test":"mocha"},"devDependencies":{"expect.js":"*","mocha":"*"},"keywords":["command-line","runner","cli"],"license":"BSD","readme":"# Crun.js\n\nCrun is a Node.js module which provides methods to map system commands to JavaScript functions, to allow better reusability of system command calls. Function parameters represent argument strings which are interpolated via #{…} symbols with arbitrary names.\n\nA ChildProcess object is returned when calling commands without providing a callback function. If a callback function is provided, there is no return value and the results are processed through the callback.\n\n## Install\n\nInstall the module with: `npm install crun`\n\n## Example\n\n```javascript\nvar crun = require('crun');\n\n// generate commands\nvar commands = {\n\tls: 'ls -al',\n\tcp: 'cp -Rf #{src} #{dst}',\n\ttail: 'tail -f #{log}'\n};\ncrun.generate('test', commands);\n\n// run commands child_process.exec\ncrun.test.ls(function(error, result) {\n\tconsole.log('ls output: ' + result.stdout);\n});\n\ncrun.test.cp('file1', 'file2', function (error, result) {\n\tconsole.log('cp output: ' + result.stdout);\n});\n\n//run commands child_process.spawn\nvar tail = crun.test.tail('logfile');\ntail.stdout.on('data', function (data) {\n  console.log('stdout: ' + data);\n});\n\ntail.stderr.on('data', function (data) {\n  console.log('stderr: ' + data);\n});\n\ntail.on('close', function (code) {\n  console.log('child process exited with code ' + code);\n});\n```\n\n## Generated Functions\n\nA function generated by `crun.generate` needs to be passed the same number of parameters as the number of #{…} symbols in the command string. For example, the `cp` command in the example accepts two parameters, src and dst. the final parameter is the callback function for the command.\n\nThe callback function consists of two parameters: the error object and the result object. The result object has the following properties:\n\n- command: the command with the #{} placeholders replaced with passed in values\n- stdout: contents of the standard output stream of the command\n- stderr: contents of the standard error stream of the command\n\n","readmeFilename":"README.md","_id":"crun@0.0.5","dist":{"shasum":"6f18d4f80c12b23410a88139c48074f3290eb1fb","tarball":"https://registry.npmjs.org/crun/-/crun-0.0.5.tgz","integrity":"sha512-QHpMDX3vkS/4YtBk3GuMd1scwETy3s+UgvTMcqpAFL7EDXOJ4dWEqEqGjkOETLyJUmTweF+tHXl5DSa2KYwpRQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGXI1mvYsOmB1levCb7RQ+/KZP8kvStg7AX/ONqUG7+0AiBjWaVPN7zNDOz2jVyEJEIpl7QAVzERj/KOUQj2QtRxug=="}]},"_from":".","_npmVersion":"1.3.3","_npmUser":{"name":"slao","email":"slao258@gmail.com"},"maintainers":[{"name":"slao","email":"slao258@gmail.com"}]},"0.0.6":{"name":"crun","description":"Generates JavaScript functions mapped to system commands","main":"./lib/crun.js","author":{"name":"Sean Lao"},"version":"0.0.6","repository":{"type":"git","url":"https://github.com/slao/crun.git"},"bugs":{"url":"https://github.com/slao/crun/issues"},"scripts":{"test":"mocha"},"devDependencies":{"expect.js":"*","mocha":"*"},"keywords":["command-line","runner","cli"],"license":"BSD","readme":"# Crun.js\n\nCrun is a Node.js module which provides methods to map system commands to JavaScript functions, to allow better reusability of system command calls. Function parameters represent argument strings which are interpolated via #{…} symbols with arbitrary names.\n\nA ChildProcess object is returned when calling commands without providing a callback function. If a callback function is provided, there is no return value and the results are processed through the callback.\n\n## Install\n\nInstall the module with: `npm install crun`\n\n## Example\n\n```javascript\nvar crun = require('crun');\n\n// generate commands\nvar commands = {\n\tls: 'ls -al',\n\tcp: 'cp -Rf #{src} #{dst}',\n\ttail: 'tail -f #{log}'\n};\ncrun.generate('test', commands);\n\n\n// run commands child_process.exec\ncrun.test.ls(function(error, result) {\n\tconsole.log('ls output: ' + result.stdout);\n});\n\ncrun.test.cp('file1', 'file2', function (error, result) {\n\tconsole.log('cp output: ' + result.stdout);\n});\n\n\n// run with no console logging\ncrun.test.cp('file1', 'file2', { silent: true }, function (error, result) {\n\tconsole.log('cp output: ' + result.stdout);\n});\n\n\n//run commands child_process.spawn\nvar tail = crun.test.tail('logfile');\ntail.stdout.on('data', function (data) {\n  console.log('stdout: ' + data);\n});\n\ntail.stderr.on('data', function (data) {\n  console.log('stderr: ' + data);\n});\n\ntail.on('close', function (code) {\n  console.log('child process exited with code ' + code);\n});\n```\n\n## Generated Functions\n\nA function generated by `crun.generate` needs to be passed the same number of parameters as the number of #{…} symbols in the command string. For example, the `cp` command in the example accepts two parameters, src and dst. The last two parameters for all generated functions are the `options` object and the callback function.\n\nThe options object allows controlling specific execution behavior, via set properties of the object (see example above):\n\n- `silent`: false by default, set to true to turn off console logging\n\nThe callback function consists of two parameters: the error object and the result object. The result object has the following properties:\n\n- `command`: the command with the #{} placeholders replaced with passed in values\n- `stdout`: contents of the standard output stream of the command\n- `stderr`: contents of the standard error stream of the command\n\n","readmeFilename":"README.md","_id":"crun@0.0.6","dist":{"shasum":"b7633ba3d76bb27ccc94117141573651d5328dbb","tarball":"https://registry.npmjs.org/crun/-/crun-0.0.6.tgz","integrity":"sha512-q/kMGn+0mXPDgnuL8uzat7N+eJ8hiGI4uslxNDw9yKTje+pP7wJdt3C8kN6M74FAxKvpbPtuIcp5wXkZifwAFQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGqe8Ewes/z63/Qaef3ehm6GxicL4HlCwx8WlHSspR6/AiBNRgbNqzA+JPeNLslnFnelxzhCDq1rJQgZslOUZT/RJQ=="}]},"_from":".","_npmVersion":"1.3.3","_npmUser":{"name":"slao","email":"slao258@gmail.com"},"maintainers":[{"name":"slao","email":"slao258@gmail.com"}]},"0.0.7":{"name":"crun","description":"Generates JavaScript functions mapped to system commands","main":"./lib/crun.js","author":{"name":"Sean Lao"},"version":"0.0.7","repository":{"type":"git","url":"https://github.com/slao/crun.git"},"bugs":{"url":"https://github.com/slao/crun/issues"},"scripts":{"test":"mocha"},"devDependencies":{"expect.js":"*","mocha":"*"},"keywords":["command-line","runner","cli"],"license":"BSD","readme":"# Crun.js\n\nCrun is a Node.js module which provides methods to map system commands to JavaScript functions, to allow better reusability of system command calls. Function parameters represent argument strings which are interpolated via #{…} symbols with arbitrary names.\n\nA ChildProcess object is returned when calling commands without providing a callback function. If a callback function is provided, there is no return value and the results are processed through the callback.\n\n## Install\n\nInstall the module with: `npm install crun`\n\n## Example\n\n```javascript\nvar crun = require('crun');\n\n// generate commands\nvar commands = {\n\tls: 'ls -al',\n\tcp: 'cp -Rf #{src} #{dst}',\n\ttail: 'tail -f #{log}'\n};\ncrun.generate('test', commands);\n\n\n// run commands child_process.exec\ncrun.test.ls(function(error, result) {\n\tconsole.log('ls output: ' + result.stdout);\n});\n\ncrun.test.cp('file1', 'file2', function (error, result) {\n\tconsole.log('cp output: ' + result.stdout);\n});\n\n\n// run with no console logging\ncrun.test.cp('file1', 'file2', { silent: true }, function (error, result) {\n\tconsole.log('cp output: ' + result.stdout);\n});\n\n\n//run commands child_process.spawn\nvar tail = crun.test.tail('logfile');\ntail.stdout.on('data', function (data) {\n  console.log('stdout: ' + data);\n});\n\ntail.stderr.on('data', function (data) {\n  console.log('stderr: ' + data);\n});\n\ntail.on('close', function (code) {\n  console.log('child process exited with code ' + code);\n});\n```\n\n## Generated Functions\n\nA function generated by `crun.generate` needs to be passed the same number of parameters as the number of #{…} symbols in the command string. For example, the `cp` command in the example accepts two parameters, src and dst. The last two parameters for all generated functions are the `options` object and the callback function, which are both optional. If the callback function isn't defined, a function call returns a ChildProcess object as if `child_process.spawn()` were called.\n\nThe options object allows controlling specific execution behavior, via set properties of the object (see example above):\n\n- `silent`: false by default, set to true to turn off console logging\n\nThe callback function consists of two parameters: the error object and the result object. The result object has the following properties:\n\n- `command`: the command with the #{} placeholders replaced with passed in values\n- `stdout`: contents of the standard output stream of the command\n- `stderr`: contents of the standard error stream of the command\n\n","readmeFilename":"README.md","_id":"crun@0.0.7","dist":{"shasum":"7fa366a8ddf20d136ec796f61dd744f0b5be26a7","tarball":"https://registry.npmjs.org/crun/-/crun-0.0.7.tgz","integrity":"sha512-xTcMnrySS9Xwhep3uuIqUisxSbOjdhf62ge/XfWUuEkGLh/Xc6VfozR80+hVU1IejtkF8aSO2NUQFDdx74cUBA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD+s6g/I1DIn+Eb5+dn8Lz9gjMfuTfxl2rNv9rCBFyQ/wIhAP5a+qlwzqiN1BPsXSkKcb9lkOw5aRorUUO9+RpR6gd/"}]},"_from":".","_npmVersion":"1.3.3","_npmUser":{"name":"slao","email":"slao258@gmail.com"},"maintainers":[{"name":"slao","email":"slao258@gmail.com"}]},"0.1.0":{"name":"crun","description":"Generates JavaScript functions mapped to system commands","main":"./lib/crun.js","author":{"name":"Sean Lao"},"version":"0.1.0","repository":{"type":"git","url":"https://github.com/slao/crun.git"},"bugs":{"url":"https://github.com/slao/crun/issues"},"scripts":{"test":"mocha"},"devDependencies":{"expect.js":"*","mocha":"*"},"keywords":["command-line","runner","cli"],"license":"BSD","readme":"# Crun.js\n\nCrun is a Node.js module which provides methods to map system commands to JavaScript functions, to allow better reusability of system command calls. Function parameters represent argument strings which are interpolated via #{…} symbols with arbitrary names.\n\nA ChildProcess object is returned when calling commands without providing a callback function. If a callback function is provided, there is no return value and the results are processed through the callback.\n\n## Install\n\nInstall the module with: `npm install crun`\n\n## Example\n\n```javascript\nvar crun = require('crun');\n\n// generate commands\nvar commands = {\n\tls: 'ls -al',\n\tcp: 'cp -Rf #{src} #{dst}',\n\ttail: 'tail -f #{log}'\n};\ncrun.generate('test', commands);\n\n\n// run commands child_process.exec\ncrun.test.ls(function(error, result) {\n\tconsole.log('ls output: ' + result.stdout);\n});\n\ncrun.test.cp('file1', 'file2', function (error, result) {\n\tconsole.log('cp output: ' + result.stdout);\n});\n\n\n// run with no console logging\ncrun.test.cp('file1', 'file2', { silent: true }, function (error, result) {\n\tconsole.log('cp output: ' + result.stdout);\n});\n\n\n//run commands child_process.spawn\nvar tail = crun.test.tail('logfile');\ntail.stdout.on('data', function (data) {\n  console.log('stdout: ' + data);\n});\n\ntail.stderr.on('data', function (data) {\n  console.log('stderr: ' + data);\n});\n\ntail.on('close', function (code) {\n  console.log('child process exited with code ' + code);\n});\n```\n\n## Generated Functions\n\nA function generated by `crun.generate` needs to be passed the same number of parameters as the number of #{…} symbols in the command string. For example, the `cp` command in the example accepts two parameters, src and dst. The last two parameters for all generated functions are the `options` object and the callback function, which are both optional. If the callback function isn't defined, a function call returns a ChildProcess object as if `child_process.spawn()` were called.\n\nThe options object allows controlling specific execution behavior, via set properties of the object (see example above):\n\n- `silent`: false by default, set to true to turn off console logging\n\nThe callback function consists of two parameters: the error object and the result object. The result object has the following properties:\n\n- `command`: the command with the #{} placeholders replaced with passed in values\n- `stdout`: contents of the standard output stream of the command\n- `stderr`: contents of the standard error stream of the command\n- `stdoutt`: trimmed stdout - stdout without leading or trailing whitespace\n- `stderrt`: trimmed stderr - stderr without leading or trailing whitespace\n\n","readmeFilename":"README.md","_id":"crun@0.1.0","dist":{"shasum":"ed0d9d07909566facd92c8f214083cbc8a989a29","tarball":"https://registry.npmjs.org/crun/-/crun-0.1.0.tgz","integrity":"sha512-bkinlNOYiGfGinj8MaeVEPjrAbv9Cn6OukwmteHbAwYsk/mlLTHo3r0ebxJ9ohuj+V7pvj6p5WZpJBvDyp5Q+A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDiHr9e9NR4kGeYfrs8q076ir7BmqdrTAwewnGhRjGuxQIhAL9KnqFGVQRrIeP48YASeAMdLyj8rK/jziUdOSCYb/zG"}]},"_from":".","_npmVersion":"1.3.3","_npmUser":{"name":"slao","email":"slao258@gmail.com"},"maintainers":[{"name":"slao","email":"slao258@gmail.com"}]},"0.1.1":{"name":"crun","description":"Generates JavaScript functions mapped to system commands","main":"./lib/crun.js","author":{"name":"Sean Lao"},"version":"0.1.1","repository":{"type":"git","url":"https://github.com/slao/crun.git"},"bugs":{"url":"https://github.com/slao/crun/issues"},"scripts":{"test":"mocha"},"devDependencies":{"expect.js":"*","mocha":"*"},"keywords":["command-line","runner","cli"],"licenses":[{"type":"BSD","url":"https://raw.github.com/slao/crun/master/LICENSE"}],"readme":"# Crun.js\n\nCrun is a Node.js module which provides methods to map system commands to JavaScript functions, to allow better reusability of system command calls. Function parameters represent argument strings which are interpolated via #{…} symbols with arbitrary names.\n\nA ChildProcess object is returned when calling commands without providing a callback function. If a callback function is provided, there is no return value and the results are processed through the callback.\n\n## Install\n\nInstall the module with: `npm install crun`\n\n## Example\n\n```javascript\nvar crun = require('crun');\n\n// generate commands\nvar commands = {\n\tls: 'ls -al',\n\tcp: 'cp -Rf #{src} #{dst}',\n\ttail: 'tail -f #{log}'\n};\ncrun.generate('test', commands);\n\n\n// run commands child_process.exec\ncrun.test.ls(function(error, result) {\n\tconsole.log('ls output: ' + result.stdout);\n});\n\ncrun.test.cp('file1', 'file2', function (error, result) {\n\tconsole.log('cp output: ' + result.stdout);\n});\n\n\n// run with no console logging\ncrun.test.cp('file1', 'file2', { silent: true }, function (error, result) {\n\tconsole.log('cp output: ' + result.stdout);\n});\n\n\n//run commands child_process.spawn\nvar tail = crun.test.tail('logfile');\ntail.stdout.on('data', function (data) {\n  console.log('stdout: ' + data);\n});\n\ntail.stderr.on('data', function (data) {\n  console.log('stderr: ' + data);\n});\n\ntail.on('close', function (code) {\n  console.log('child process exited with code ' + code);\n});\n```\n\n## Generated Functions\n\nA function generated by `crun.generate` needs to be passed the same number of parameters as the number of #{…} symbols in the command string. For example, the `cp` command in the example accepts two parameters, src and dst. The last two parameters for all generated functions are the `options` object and the callback function, which are both optional. If the callback function isn't defined, a function call returns a ChildProcess object as if `child_process.spawn()` were called.\n\nThe options object allows controlling specific execution behavior, via set properties of the object (see example above):\n\n- `silent`: false by default, set to true to turn off console logging\n\nThe callback function consists of two parameters: the error object and the result object. The result object has the following properties:\n\n- `command`: the command with the #{} placeholders replaced with passed in values\n- `stdout`: contents of the standard output stream of the command\n- `stderr`: contents of the standard error stream of the command\n- `stdoutt`: trimmed stdout - stdout without leading or trailing whitespace\n- `stderrt`: trimmed stderr - stderr without leading or trailing whitespace\n\n","readmeFilename":"README.md","_id":"crun@0.1.1","dist":{"shasum":"4549d14d42b7f1be966a6007f9e6d65ff7daef05","tarball":"https://registry.npmjs.org/crun/-/crun-0.1.1.tgz","integrity":"sha512-Ypimeu3xXsSujwNMobNs/28zgCRiHWmKDBD93kzIq8rbH+lGgwVXArhEeQWNGSlGZ61PeagJp1Rvw/yej0s96g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDufaeIMowLiWxqRBYBS9IFfFrUTHOai7zLkCDW3+FJzQIgH65QdxJZ8xqkkU1OYmCjESKY3PDeQIkHQnCTVFuiHW8="}]},"_from":".","_npmVersion":"1.3.3","_npmUser":{"name":"slao","email":"slao258@gmail.com"},"maintainers":[{"name":"slao","email":"slao258@gmail.com"}]}},"readme":"ERROR: No README data found!","maintainers":[{"name":"slao","email":"slao258@gmail.com"}],"time":{"modified":"2022-06-14T03:56:17.857Z","created":"2013-11-17T18:20:46.367Z","0.0.1":"2013-11-17T18:20:47.479Z","0.0.2":"2013-11-18T10:30:05.585Z","0.0.3":"2013-11-18T20:12:03.899Z","0.0.4":"2013-11-18T20:14:24.536Z","0.0.5":"2013-12-05T06:51:23.698Z","0.0.6":"2013-12-05T07:06:44.628Z","0.0.7":"2013-12-05T07:20:20.485Z","0.1.0":"2013-12-05T20:53:22.521Z","0.1.1":"2013-12-06T19:10:28.683Z"},"author":{"name":"Sean Lao"},"repository":{"type":"git","url":"https://github.com/slao/crun.git"},"users":{"slao":true}}