quote-unquote

1.0.0 • Public • Published

quote-unquote

quote and unquote strings. escapes internal quotes and slashes. Automatically decides whether to use single or double quotes.

q = require('quote-unquote')

q.quote (string)

foo's bar => "foo's bar" "foo's bar" => "\"foo's bar\"" "\"foo's bar\"" => "\"\\\"foo's bar\\\"\""

etc

q.unquote(quoted_string)

the reverse of the above.

"foo's bar" => foo's bar "\"foo's bar\"" => "foo's bar" "\"\\\"foo's bar\\\"\"" => "\"foo's bar\""

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i quote-unquote

Weekly Downloads

556,301

Version

1.0.0

License

MIT

Last publish

Collaborators

  • nopersonsmodules