# splitargs

> Splits strings into tokens by given separator except treating quoted part as a single token.

Latest version **0.0.7** (published 2016-04-06) · ISC license · 0 weekly downloads

## Install

```sh
npm install splitargs
pnpm add splitargs
yarn add splitargs
bun add splitargs
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.7 |
| Published | 2016-04-06 |
| First published | 2014-07-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 17 |
| Author | Elgs Chen |
| Maintainers | elgs |
| Keywords | split, args, quoted, space |

## Links

- npm: https://www.npmjs.com/package/splitargs
- Repository: https://github.com/elgs/splitargs
- Issues: https://github.com/elgs/splitargs/issues
- npm.io page: https://npm.io/package/splitargs

## Recent versions

- 0.0.7 (latest) — 2016-04-06
- 0.0.6 — 2016-04-05
- 0.0.5 — 2015-10-05
- 0.0.4 — 2015-10-04
- 0.0.3 — 2014-07-01
- 0.0.2 — 2014-07-01
- 0.0.1 — 2014-07-01
- 0.0.0 — 2014-07-01

## README

splitargs
==========
Splits strings into tokens by given separator except treating quoted part as a single token.

#Installation
`npm install splitargs`

#Usage
```javascript
var splitargs = require('splitargs');

var i1 = "I said 'I am sorry.', and he said \"it doesn't matter.\"";
var o1 = splitargs(i1);
console.log(o1);
/*
[ 'I',
  'said',
  'I am sorry.,',
  'and',
  'he',
  'said',
  'it doesn\'t matter.' ]
*/

var i2 = "I said \"I am sorry.\", and he said \"it doesn't matter.\"";
var o2 = splitargs(i2);
console.log(o2);
/*
[ 'I',
  'said',
  'I am sorry.,',
  'and',
  'he',
  'said',
  'it doesn\'t matter.' ]
*/

var i3 = 'I said "I am sorry.", and he said "it doesn\'t matter."';
var o3 = splitargs(i3);
console.log(o3);
/*
[ 'I',
  'said',
  'I am sorry.,',
  'and',
  'he',
  'said',
  'it doesn\'t matter.' ]
*/

var i4 = 'I said \'I am sorry.\', and he said "it doesn\'t matter."';
var o4 = splitargs(i4);
console.log(o4);
/*
[ 'I',
  'said',
  'I am sorry.,',
  'and',
  'he',
  'said',
  'it doesn\'t matter.' ]
*/
```

---
_Source: https://npm.io/package/splitargs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
