postcss-normalize-url
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

postcss-normalize-url Build Status NPM version Dependency Status

Normalize URLs with PostCSS.

Install via npm:

npm install postcss-normalize-url --save

Example

var postcss = require('postcss')
var normalize = require('postcss-normalize-url');

var css = 'h1 { background: url("http://site.com:80/image.jpg") }';
console.log(postcss(normalize()).process(css).css);

// => 'h1 { background: url(http://site.com/image.jpg) }'

Note that this module will also try to normalize relative URLs, and is capable of stripping unnecessary quotes. For more examples, see the tests.

API

normalize([options])

Please see the normalize-url documentation. By default, normalizeProtocol and stripFragment are set to false.

Contributing

Pull requests are welcome. If you add functionality, then please add unit tests to cover it.

License

MIT © Ben Briggs

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
7.0.1914,171latest
5.0.0-rc.2403next
4.0.0-nightly.2020.2.623nightly

Version History

VersionDownloads (Last 7 Days)Published
7.0.1914,171
7.0.0870,080
6.0.21,879,075
6.0.1134,347
6.0.0297,314
5.1.05,277,017
5.0.552,121
5.0.4102,042
5.0.333,213
5.0.2255,701
5.0.111,446
5.0.012,795
5.0.0-rc.2403
5.0.0-rc.12
5.0.0-rc.03
4.0.0-nightly.2020.2.623
4.0.0-nightly.2020.1.113
4.0.0-nightly.2020.1.93
4.0.0-nightly.2020.10.203
4.0.0-nightly.2020.9.93
4.0.0-nightly.2020.9.33
4.0.0-nightly.2020.9.13
4.0.0-nightly.2020.8.293
4.0.0-nightly.2020.8.254
4.0.0-nightly.2020.8.243
4.0.0-nightly.2020.8.173
4.0.0-nightly.2020.8.104
4.0.0-nightly.2020.8.44
4.0.0-nightly.2020.8.14
4.0.0-nightly.2020.7.313
4.0.0-nightly.2020.7.254
4.0.0-nightly.2020.7.243
4.0.12,919,928
4.0.06,313
4.0.0-rc.2152
4.0.0-rc.010
3.0.8748,607
3.0.78,501
3.0.64
3.0.53
3.0.446
3.0.34
3.0.23
3.0.14
3.0.03
2.1.36,785
2.1.24
2.1.15
2.1.03
2.0.35
2.0.23
2.0.14
2.0.04
1.2.115
1.2.03
1.1.03
1.0.24
1.0.14
1.0.06

Package Sidebar

Install

npm i postcss-normalize-url@2.0.0

Version

2.0.0

License

MIT

Last publish

Collaborators

  • beneb
  • trysound
  • ludovicofischer
  • ai
  • chriseppstein
  • andyjansson
  • evilebottnawi
  • cssnano-bot