0.1.4 • Published 6 months ago

@gallofeliz/run-process v0.1.4

Weekly downloads
-
License
ISC
Repository
github
Last release
6 months ago

Run process

npm.io

Note: This module is part of @gallofeliz/js-libs that is a personal project. It is not developed nor tested for applications that need high security or scalability.

Easily run processes:

  • Pipeable processes
  • get text, json or multijson output or stream
  • transform output
  • logged
  • high level
  • command one string (can precise shell) or array
const result = await runProcess({
    inputData: createProcess({
        logger,
        command: 'md5sum | awk \'{print $1}\'',
        inputData: createProcess({
            logger,
            command: ['echo', 'hello']
        })
    }),
    logger,
    command: ['wc', '-c'],
    outputType: 'text',
    outputTransformation: '$join(["There is ", $string(),  " words"])'
})

strictEqual(result, 'There is 33 words')