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.1387,943latest
5.0.0-rc.2200next
4.0.0-nightly.2020.2.618nightly

Version History

VersionDownloads (Last 7 Days)Published
7.0.1387,943
7.0.01,347,229
6.0.21,791,985
6.0.1149,097
6.0.0296,736
5.1.05,004,241
5.0.528,867
5.0.4107,819
5.0.345,149
5.0.2146,866
5.0.18,016
5.0.014,427
5.0.0-rc.2200
5.0.0-rc.13
5.0.0-rc.00
4.0.0-nightly.2020.2.618
4.0.0-nightly.2020.1.110
4.0.0-nightly.2020.1.90
4.0.0-nightly.2020.10.204
4.0.0-nightly.2020.9.9110
4.0.0-nightly.2020.9.30
4.0.0-nightly.2020.9.10
4.0.0-nightly.2020.8.293
4.0.0-nightly.2020.8.252
4.0.0-nightly.2020.8.241
4.0.0-nightly.2020.8.171
4.0.0-nightly.2020.8.102
4.0.0-nightly.2020.8.40
4.0.0-nightly.2020.8.11
4.0.0-nightly.2020.7.310
4.0.0-nightly.2020.7.250
4.0.0-nightly.2020.7.240
4.0.12,250,590
4.0.01,857
4.0.0-rc.225
4.0.0-rc.01
3.0.8380,686
3.0.7767
3.0.64
3.0.54
3.0.430
3.0.34
3.0.23
3.0.12
3.0.03
2.1.34,361
2.1.20
2.1.12
2.1.01
2.0.35
2.0.22
2.0.12
2.0.01
1.2.142
1.2.02
1.1.03
1.0.21
1.0.11
1.0.04

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