Generate a css image url
$ npm install --save image-url
var imageUrl = require('image-url')
imageUrl('http://website.com/image.jpg')
//=> url("http://website.com/image.jpg")
imageUrl('http://website.com/image"quote".jpg')
//=> url("http://website.com/image\\"quote\\".jpg")
You should always wrap your css urls in quotes, because parentheses in a url are valid.
This does that and also escapes double quotes inside.
MIT © Andrew Joslin