$ npm install import-regex
Regular expression for matching CSS @imports
$ npm install --save import-regex
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');']
MIT © Kevin Mårtensson
© 2010 - cnpmjs.org x YWFE | Home | YWFE