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

1.0.2 • 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.1486,587latest
5.0.0-rc.2362next
4.0.0-nightly.2020.2.625nightly

Version History

VersionDownloads (Last 7 Days)Published
7.0.1486,587
7.0.01,281,476
6.0.21,879,766
6.0.1150,648
6.0.0311,540
5.1.05,342,307
5.0.536,474
5.0.4105,567
5.0.340,973
5.0.2144,583
5.0.110,304
5.0.012,750
5.0.0-rc.2362
5.0.0-rc.11
5.0.0-rc.00
4.0.0-nightly.2020.2.625
4.0.0-nightly.2020.1.111
4.0.0-nightly.2020.1.91
4.0.0-nightly.2020.10.202
4.0.0-nightly.2020.9.96
4.0.0-nightly.2020.9.38
4.0.0-nightly.2020.9.11
4.0.0-nightly.2020.8.291
4.0.0-nightly.2020.8.251
4.0.0-nightly.2020.8.242
4.0.0-nightly.2020.8.171
4.0.0-nightly.2020.8.104
4.0.0-nightly.2020.8.41
4.0.0-nightly.2020.8.11
4.0.0-nightly.2020.7.312
4.0.0-nightly.2020.7.251
4.0.0-nightly.2020.7.246
4.0.12,231,728
4.0.02,574
4.0.0-rc.220
4.0.0-rc.01
3.0.8384,013
3.0.7750
3.0.66
3.0.52
3.0.42
3.0.31
3.0.21
3.0.11
3.0.01
2.1.34,713
2.1.21
2.1.12
2.1.01
2.0.35
2.0.21
2.0.11
2.0.02
1.2.115
1.2.01
1.1.01
1.0.21
1.0.11
1.0.012

Package Sidebar

Install

npm i postcss-normalize-url@1.0.2

Version

1.0.2

License

MIT

Last publish

Collaborators

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