npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

separator-escape

0.0.1

@dominictarr

npmHomeRepoSnykSocket
Downloads:216718
$ npm install separator-escape
DailyWeeklyMonthlyYearly

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