SkillAgentSearch skills...

Spawnify

Create new process in node.

Install / Use

/learn @coderaiser/Spawnify
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Spawnify License NPM version Build Status

Create new processes, change directories, auto switch between spawn and exec.

Install

npm i spawnify --save

How to use?

const spawnify = require('spawnify');
const spawn = spawnify('ls -lha', {
    cwd: __dirname,
});

spawn.on('error', (error) => {
    console.error(error.message);
});

/* not mandatory */
spawn.on('data', (data) => {
    console.log(data);
});

/* not mandatory */
spawn.on('start', () => {
    console.log('process has been started');
    // kill process after start
    spawn.kill();
});

/* not mandatory */
spawn.on('path', (path) => {
    console.log('directory was changed', path);
});

/* not mandatory */
spawn.on('close', () => {
    console.log('process closed');
});

/* not mandatory */
spawn.on('exit', () => {
    console.log('process closed');
});

License

MIT

View on GitHub
GitHub Stars6
CategoryDevelopment
Updated2y ago
Forks2

Languages

JavaScript

Security Score

75/100

Audited on Aug 27, 2023

No findings