Skip to content

ajoslin/image-url

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

image-url Build Status

Generate a css image url

Install

$ npm install --save image-url

Usage

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")

Rationale

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.

License

MIT © Andrew Joslin

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published