Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

shellwords

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shellwords - npm Package Compare versions

Comparing version 0.1.1 to 1.0.0

dist/browser/index.js

36

package.json
{
"author": "Jimmy Cuadra <jimmy@jimmycuadra.com> (http://jimmycuadra.com/)",
"author": "Jimmy Cuadra <jimmy@jimmycuadra.com>",
"name": "shellwords",
"description": "Manipulate strings according to the word parsing rules of the UNIX Bourne shell.",
"version": "0.1.1",
"version": "1.0.0",
"homepage": "https://github.com/jimmycuadra/shellwords",

@@ -11,6 +11,21 @@ "repository": {

},
"main": "./lib/shellwords",
"files": ["lib"],
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"browser": "dist/browser/index.js",
"types": "dist/shellwords.d.ts",
"files": [
"dist",
"src"
],
"scripts": {
"test": "cake spec"
"browser": "serve -l 3000",
"build": "rm -rf dist && yarn run build:browser && yarn run build:cjs && yarn run build:esm && yarn run tsc:build",
"build:browser": "esbuild --bundle src/shellwords.ts --outfile=dist/browser/index.js --sourcemap --sources-content=false --format=iife --global-name=shellwords",
"build:cjs": "esbuild --bundle src/shellwords.ts --outfile=dist/cjs/index.js --sourcemap --sources-content=false --format=cjs",
"build:esm": "esbuild --bundle src/shellwords.ts --outfile=dist/esm/index.js --sourcemap --sources-content=false --format=esm",
"prebrowser": "yarn run build",
"prepack": "yarn run build",
"prepublish": "yarn run build",
"test": "jest",
"tsc:build": "tsc -p tsconfig.build.json"
},

@@ -20,5 +35,12 @@ "license": "MIT",

"devDependencies": {
"jasmine-node": "~1.0.26",
"nodewatch": "~0.1.0"
"@babel/core": "^7.16.12",
"@babel/preset-env": "^7.16.11",
"@babel/preset-typescript": "^7.16.7",
"@types/jest": "^27.4.0",
"babel-jest": "^27.4.6",
"esbuild": "^0.14.14",
"jest": "^27.4.7",
"serve": "^13.0.2",
"typescript": "^4.5.5"
}
}
# Shellwords
Shellwords provides functions to manipulate strings according to the word parsing rules of the UNIX Bourne shell. It is based on [the Ruby module of the same name](http://www.ruby-doc.org/stdlib-1.9.3/libdoc/shellwords/rdoc/Shellwords.html).
Shellwords provides functions to manipulate strings according to the word parsing rules of the UNIX Bourne shell. It is based on [the Ruby module of the same name](https://docs.ruby-lang.org/en/3.1/Shellwords.html).
## Installation
Add "shellwords" to your `package.json` file and run `npm install`.
With npm:
```
npm install shellwords
```
With Yarn:
```
yarn add shellwords
```
## API
Shellwords exports the following functions, shown here in the TypeScript declaration file format.
``` typescript
/**
* Splits a string into an array of tokens in the same way the UNIX Bourne shell does.
*
* @param line A string to split.
* @returns An array of the split tokens.
*/
export declare const split: (line?: string) => string[];
/**
* Escapes a string so that it can be safely used in a Bourne shell command line.
*
* @param str A string to escape.
* @returns The escaped string.
*/
export declare const escape: (str?: string) => string;
```
## Example
``` javascript
var shellwords = require("shellwords");
``` typescript
import { escape, split } from "shellwords";

@@ -20,1 +52,5 @@ shellwords.split("foo 'bar baz'");

```
## Legal
shellwords is released under the MIT license. See `LICENSE`.
lib/shellwords.js

Sorry, the diff of this file is not supported yet

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