1.0.1 • Published 2 years ago

@fujia/spawn v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

An easy-to-use spawn function of node.js.

English | 简体中文

Installing

Using npm:

npm install @fujia/spawn

Using yarn:

yarn add @fujia/spawn

Usage

Simply to use, as follows:

import { spawn, spawnAsync } from '@fujia/spawn';

spawn('npm', ['get', 'registry'], {
  stdio: 'inherit',
  shell: true,
});

async function getNpmRegistry() {
  const code = await spawnAsync('npm', ['get', 'registry'], {
    stdio: 'inherit',
    shell: true,
  });

  console.log('exec code', code);
}

getNpmRegistry();

References

  1. child_process.