@yarnpkg/shell
Last updated 5 years ago by arcanis .
Repository · Original npm · Tarball · package.json
$ gnpm install @yarnpkg/shell 
SYNC missed versions from official npm registry.

@yarnpkg/shell

A JavaScript implementation of a bash-like shell (we use it in Yarn 2 to provide cross-platform scripting). This package exposes an API that abstracts both the parser and the interpreter; should you only need the parser you can check out @yarnpkg/parsers, but you probably won't need it.

Usage

import {execute} from '@yarnpkg/shell';

process.exitCode = await execute(`ls "$0" | wc -l`, [process.cwd()]);

Features

  • Typechecked
  • Portable across systems
  • Supports custom JS builtins
  • Supports pipes
  • Supports glob patterns (only for files that exist on the filesystem: ls *.txt)
  • Supports logical operators
  • Supports subshells
  • Supports variables
  • Supports string manipulators
  • Supports argc/argv
  • Supports background jobs with color-coded output
  • Supports the most classic builtins
  • Doesn't necessarily need to access the fs

Help Wanted

  • Full glob support (mv build/{index.js,index.build.js}, echo {foo,bar}, FOO=a,b echo {$FOO,x})
  • More string manipulators

Non-Goals

  • Perfect POSIX compliance (basic scripting is enough for now)
  • Multiline scripts (we mostly target one-liners)
  • Control structures (same reason)

Current Tags

  • 4.0.0                                ...           latest (a year ago)
  • 3.3.0                                ...           v3 (a year ago)

119 Versions

  • 3.3.0                                ...           a year ago
  • 4.0.0                                ...           a year ago
  • 4.0.0-rc.53                                ...           a year ago
  • 4.0.0-rc.52                                ...           a year ago
  • 4.0.0-rc.51                                ...           a year ago
  • 4.0.0-rc.50                                ...           a year ago
  • 4.0.0-rc.49                                ...           a year ago
  • 4.0.0-rc.48                                ...           a year ago
  • 4.0.0-rc.47                                ...           a year ago
  • 4.0.0-rc.46                                ...           a year ago
  • 4.0.0-rc.45                                ...           2 years ago
  • 4.0.0-rc.44                                ...           2 years ago
  • 4.0.0-rc.43                                ...           2 years ago
  • 4.0.0-rc.42                                ...           2 years ago
  • 4.0.0-rc.41                                ...           2 years ago
  • 4.0.0-rc.40                                ...           2 years ago
  • 4.0.0-rc.39                                ...           2 years ago
  • 4.0.0-rc.38                                ...           2 years ago
  • 4.0.0-rc.37                                ...           2 years ago
  • 4.0.0-rc.36                                ...           2 years ago
  • 4.0.0-rc.35                                ...           2 years ago
  • 4.0.0-rc.34                                ...           2 years ago
  • 4.0.0-rc.33                                ...           2 years ago
  • 4.0.0-rc.32                                ...           2 years ago
  • 4.0.0-rc.31                                ...           2 years ago
  • 4.0.0-rc.30                                ...           2 years ago
  • 4.0.0-rc.29                                ...           2 years ago
  • 3.2.5                                ...           2 years ago
  • 4.0.0-rc.28                                ...           2 years ago
  • 4.0.0-rc.27                                ...           2 years ago
  • 4.0.0-rc.26                                ...           2 years ago
  • 4.0.0-rc.25                                ...           2 years ago
  • 4.0.0-rc.24                                ...           2 years ago
  • 4.0.0-rc.23                                ...           2 years ago
  • 4.0.0-rc.22                                ...           2 years ago
  • 4.0.0-rc.21                                ...           2 years ago
  • 4.0.0-rc.20                                ...           2 years ago
  • 4.0.0-rc.18                                ...           2 years ago
  • 4.0.0-rc.17                                ...           2 years ago
  • 4.0.0-rc.16                                ...           2 years ago
  • 3.2.4                                ...           2 years ago
  • 4.0.0-rc.15                                ...           2 years ago
  • 4.0.0-rc.14                                ...           2 years ago
  • 3.2.3                                ...           2 years ago
  • 4.0.0-rc.12                                ...           2 years ago
  • 4.0.0-rc.11                                ...           2 years ago
  • 4.0.0-rc.10                                ...           2 years ago
  • 4.0.0-rc.9                                ...           2 years ago
  • 4.0.0-rc.8                                ...           2 years ago
  • 4.0.0-rc.7                                ...           2 years ago
  • 4.0.0-rc.6                                ...           3 years ago
  • 3.2.2                                ...           3 years ago
  • 3.2.1                                ...           3 years ago
  • 4.0.0-rc.5                                ...           3 years ago
  • 4.0.0-rc.4                                ...           3 years ago
  • 4.0.0-rc.3                                ...           3 years ago
  • 4.0.0-rc.2                                ...           3 years ago
  • 4.0.0-rc.1                                ...           3 years ago
  • 3.2.0                                ...           3 years ago
  • 3.2.0-rc.14                                ...           3 years ago
  • 3.2.0-rc.13                                ...           3 years ago
  • 3.2.0-rc.12                                ...           3 years ago
  • 3.2.0-rc.11                                ...           3 years ago
  • 3.2.0-rc.10                                ...           3 years ago
  • 3.2.0-rc.9                                ...           3 years ago
  • 3.2.0-rc.8                                ...           3 years ago
  • 3.2.0-rc.7                                ...           3 years ago
  • 3.2.0-rc.6                                ...           3 years ago
  • 3.2.0-rc.5                                ...           3 years ago
  • 3.2.0-rc.4                                ...           3 years ago
  • 3.2.0-rc.3                                ...           3 years ago
  • 3.2.0-rc.2                                ...           3 years ago
  • 3.2.0-rc.1                                ...           3 years ago
  • 3.1.0                                ...           3 years ago
  • 3.1.0-rc.10                                ...           3 years ago
  • 3.1.0-rc.9                                ...           3 years ago
  • 3.1.0-rc.8                                ...           3 years ago
  • 3.1.0-rc.7                                ...           3 years ago
  • 3.1.0-rc.6                                ...           3 years ago
  • 3.1.0-rc.5                                ...           3 years ago
  • 3.1.0-rc.4                                ...           3 years ago
  • 3.1.0-rc.3                                ...           3 years ago
  • 3.1.0-rc.2                                ...           3 years ago
  • 3.1.0-rc.1                                ...           3 years ago
  • 3.0.1-rc.5                                ...           3 years ago
  • 3.0.1-rc.4                                ...           3 years ago
  • 3.0.1-rc.3                                ...           3 years ago
  • 3.0.1-rc.2                                ...           3 years ago
  • 3.0.1-rc.1                                ...           3 years ago
  • 3.0.0                                ...           3 years ago
  • 3.0.0-rc.13                                ...           3 years ago
  • 3.0.0-rc.12                                ...           3 years ago
  • 3.0.0-rc.11                                ...           3 years ago
  • 3.0.0-rc.10                                ...           3 years ago
  • 3.0.0-rc.9                                ...           3 years ago
  • 3.0.0-rc.8                                ...           3 years ago
  • 3.0.0-rc.7                                ...           3 years ago
  • 3.0.0-rc.6                                ...           3 years ago
  • 3.0.0-rc.5                                ...           4 years ago
  • 3.0.0-rc.4                                ...           4 years ago
  • 3.0.0-rc.3                                ...           4 years ago
  • 3.0.0-rc.2                                ...           4 years ago
  • 3.0.0-rc.1                                ...           4 years ago
  • 2.4.1                                ...           4 years ago
  • 2.4.0                                ...           4 years ago
  • 2.3.0                                ...           4 years ago
  • 2.2.0                                ...           4 years ago
  • 2.1.0                                ...           4 years ago
  • 2.0.0-rc.13                                ...           4 years ago
  • 2.0.0-rc.12                                ...           4 years ago
  • 2.0.0-rc.11                                ...           5 years ago
  • 2.0.0-rc.10                                ...           5 years ago
  • 2.0.0-rc.9                                ...           5 years ago
  • 2.0.0-rc.8                                ...           5 years ago
  • 2.0.0-rc.7                                ...           5 years ago
  • 2.0.0-rc.6                                ...           5 years ago
  • 2.0.0-rc.5                                ...           5 years ago
  • 2.0.0-rc.4                                ...           5 years ago
  • 2.0.0-rc.2                                ...           5 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dev Dependencies (3)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |