Comparing version 0.1.1 to 1.0.0
{ | ||
"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`. |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
16286
12
308
0
56
9
1