Skip to content

dominictarr/quote-unquote

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published