JSPM

import-regex

1.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 29256
  • Score
    100M100P100Q135201F
  • License MIT

Regular expression for matching CSS @imports

Package Exports

  • import-regex

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (import-regex) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

import-regex Build Status

Regular expression for matching CSS @imports

Install

$ npm install --save import-regex

Usage

var importRegex = require('import-regex');

importRegex().test('@import url(\'foo.css\'); foo bar');
//=> true

importRegex({ exact: true }).test('@import url(\'foo.css\'); foo bar');
//=> false

importRegex({ exact: true }).test('@import url(\'foo.css\');');
//=> true

'foo @import url(\'foo.css\'); bar @import url(\'bar.css\');'.match(importRegex());
//=> ['@import url('foo.css');', '@import url('bar.css');']

License

MIT © Kevin Mårtensson