New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

create-process

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-process - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

15

index.js
const spawn = require('cross-spawn')
function parseCommand (str) {
const config = {}
const strData = str.split(' ')
config.cmd = strData.shift()
config.args = strData
config.opts = { cwd: process.cwd() }
return config
}
function createProcess (config) {
if (typeof config === 'string') {
config = parseCommand(config)
}
const name = config.name

@@ -26,3 +39,3 @@ const tag = `[${name}]`

p.on('error', (err) => console.log(err))
p.on('close', (c) => console.log(`process '${name}' exited with code: ${c}`))
p.on('close', (c) => console.log(`process exited with code: ${c}`))
}

@@ -29,0 +42,0 @@

{
"name": "create-process",
"version": "0.0.3",
"description": "Small utility function to help your create and manage node processes more easily",
"version": "0.0.4",
"description": "Small utility library to help your create and manage node processes more easily",
"main": "index.js",
"scripts": {},
"keywords": ["create", "process", "spawn"],
"keywords": [
"create",
"process",
"manager",
"spawn",
"create-process"
],
"author": {

@@ -13,2 +19,6 @@ "name": "Kevin Karsopawiro",

},
"repository": {
"type" : "git",
"url" : "https://github.com/afterburn/create-process"
},
"license": "MIT",

@@ -15,0 +25,0 @@ "dependencies": {

# create-process
Small utility function to help your create and manage node processes more easily.
![enter image description here](https://img.shields.io/npm/dt/create-process)
Small utility library to help your create and manage node processes more easily.
(work in progress)
## Installation
npm install --save create-process
```shell
npm install --save create-process
```
## Usage
```javascript
const createProcess = require('createProcess')
// Simple usage:
const process = createProcess('npm run build')
// Advanced usage:
const process = createProcess({
name: 'webpack',
cmd: 'npm',
args: ['run', 'build'],
opts: {
cwd: path.join(__dirname, '..')
}
})
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc