@ayame/quotes
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

@ayamejs/quotes

Split an input with quotes.

hello "world" 'it works' “also supports iOS quotes” -> [ 'hello', 'world', 'it works', 'also supports iOS quotes' ]

Install

$ npm install @ayamejs/quotes

TypeScript typings included.

Usage

const quotes = require("@ayamejs/quotes");

quotes.parse(input, seperator);

Use it instead of your string.split logic.

Seperator defaults to a space " " but any single character string can be used to split on.

E.g: quotes.parse("hello, world", ",") -> [ 'hello', 'world' ]

Changelog

0.2.0 (12/8/2020)

  • Added a seperator option to split by different characters other than space.
  • Added TypeScript typings.

0.1.0

  • Initial release.

License

MIT License

Package Sidebar

Install

npm i @ayame/quotes

Weekly Downloads

2

Version

0.2.0

License

MIT

Unpacked Size

5.6 kB

Total Files

6

Last publish

Collaborators

  • ravener
  • freetnt5852