quote-unquote
quote and unquote strings. escapes internal quotes and slashes. Automatically decides whether to use single or double quotes.
Last updated 10 years ago by dominictarr .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install quote-unquote 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.0.0                                ...           latest (10 years ago)

1 Versions

  • 1.0.0                                ...           10 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |