npm.io
0.0.1 • Published 8 years ago

separator-escape

Licence
MIT
Version
0.0.1
Deps
0
Size
4 kB
Vulns
0
Weekly
0
Stars
7

separator-escape

split a string by a separator, with an escape.

you can choose both the separate and escape.

example

//separate by , and escape by !
var sep = require('separator-escape')(',','!')
sep.stringify(['a','b','c'])
// => "a,b,c"
// escape separator
sep.stringify(['a','x,y','c'])
// => a,x!,y,b

//escape escape
sep.stringify(['a','x!y','c'])
// => a,x!!y,b

//escape escape escape separator
sep.stringify(['a','x!,y','c'])
// => a,x!!!,y,b

License

MIT