You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 744B

12345678910111213141516171819202122232425262728293031
  1. # import-regex [![Build Status](https://travis-ci.org/kevva/import-regex.svg?branch=master)](https://travis-ci.org/kevva/import-regex)
  2. > Regular expression for matching CSS @imports
  3. ## Install
  4. ```sh
  5. $ npm install --save import-regex
  6. ```
  7. ## Usage
  8. ```js
  9. var importRegex = require('import-regex');
  10. importRegex().test('@import url(\'foo.css\'); foo bar');
  11. //=> true
  12. importRegex({ exact: true }).test('@import url(\'foo.css\'); foo bar');
  13. //=> false
  14. importRegex({ exact: true }).test('@import url(\'foo.css\');');
  15. //=> true
  16. 'foo @import url(\'foo.css\'); bar @import url(\'bar.css\');'.match(importRegex());
  17. //=> ['@import url('foo.css');', '@import url('bar.css');']
  18. ```
  19. ## License
  20. MIT © [Kevin Mårtensson](http://kevinmartensson.com)