@abmaonline/parse-less-import
v0.1.0
Published
Parse import from less file
Downloads
703
Readme
@abmaonline/parse-less-import
Parse import from less file
Originally created by LingyuCoder, but no longer available on github and made some changes to make it work with older versions of less.
Node.js >= 6
Install
$ npm install --save @abmaonline/parse-less-import
Usage
const parse = require('@abmaonline/parse-less-import');
const content = `
@import '../a';
@import './b.less';
@import (multiple) './c.less';
@import (multiple, reference) './d.less';
`;
parse(content);
/*
[ { path: '../a', keywords: [] },
{ path: './b.less', keywords: [] },
{ path: './c.less', keywords: [ 'multiple' ] },
{ path: './d.less', keywords: [ 'multiple', 'reference' ] } ]
*/
Test
$ npm run test
$ npm run test-cov