Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including sarnie with all npm packages installed. Try it out:

var sarnie = require("sarnie")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

sarnie v1.0.0

Converts a list of strings into a compact, readable representation with delimiters of choice

Build Status

sarnie

Converts a list of strings into a compact, readable representation with delimiters of choice

sarnie 'alba,albero,albergo,alberto'
# => alb(a|er(go|o|to))

sarnie 'aria:arianna' ':' '[' '+' ']'
# => aria[+nna]

What?

In British slang, sarnie is the abbreviation of sandwich. The name hints at the strings being sliced and interleaved with bread, the delimiters.

Why?

Useful when you need to pass long lists of URL params

License

Copyright (c) 2016-2017, Claudio Procida

MIT

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free