shelljs-core
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

shelljs-core

just the core logic of ShellJS without its dependency on native modules

install

npm i shelljs-core

usage

const { createShell } = require('shelljs-core');

console.log('-- shell 1:')
// shell instance working over local fs
const shell1 = createShell({
  fs: require('fs'),
  os: require('os'),
  path: require('path'),
  process: process,
  console: console,
});
console.log(shell1.ls('-lA', '.').stdout);

console.log('-- shell 2:')
// shell instance working over memfs
const shell2 = createShell({
  fs: require('memfs'),
  os: require('os-browserify'),
  path: require('path-browserify'),
  process: require('process'),
  console: require('console-browserify'),
});
shell2.mkdir('-p', '/tmp');
shell2.mkdir('-p', '/app');
console.log(shell2.ls('-lA', '/').stdout);

Readme

Keywords

Package Sidebar

Install

npm i shelljs-core

Weekly Downloads

1

Version

1.1.0

License

MIT

Unpacked Size

796 kB

Total Files

7

Last publish

Collaborators

  • sepehr-laal