forked from dependents/node-detective-sass
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
31 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,24 @@ | ||
### detective-sass [![npm](http://img.shields.io/npm/v/detective-sass.svg)](https://npmjs.org/package/detective-sass) [![npm](http://img.shields.io/npm/dm/detective-sass.svg)](https://npmjs.org/package/detective-sass) | ||
### detective-less [![npm](http://img.shields.io/npm/v/detective-less.svg)](https://npmjs.org/package/detective-less) [![npm](http://img.shields.io/npm/dm/detective-less.svg)](https://npmjs.org/package/detective-less) | ||
|
||
> Find the dependencies of a sass file | ||
> Find the dependencies of a less file | ||
`npm install --save detective-sass` | ||
`npm install --save detective-less` | ||
|
||
**Note:** This is specific to the .sass style syntax of the Sass preprocessor. For SCSS support, please see [node-detective-scss](https://github.com/dependents/node-detective-scss) | ||
|
||
It's the SASS counterpart to [detective](https://github.com/substack/node-detective), [detective-amd](https://github.com/mrjoelkemp/node-detective-amd), and [detective-es6](https://github.com/mrjoelkemp/node-detective-es6). | ||
This is a fork of a package by [mrjoelkemp](https://github.com/mrjoelkemp/) given a lack of a less detective, it is the counterpart to [detective](https://github.com/substack/node-detective), [detective-amd](https://github.com/mrjoelkemp/node-detective-amd), [detective-sass](https://github.com/mrjoelkemp/node-detective-sass), [detective-scss](https://github.com/mrjoelkemp/node-detective-scss) and [detective-es6](https://github.com/mrjoelkemp/node-detective-es6). | ||
|
||
* The AST is generated using the [gonzales-pe](https://github.com/tonyganch/gonzales-pe) parser. | ||
|
||
### Usage | ||
|
||
```js | ||
var detective = require('detective-sass'); | ||
var detective = require('detective-less'); | ||
|
||
var content = fs.readFileSync('styles.sass', 'utf8'); | ||
var content = fs.readFileSync('styles.less', 'utf8'); | ||
|
||
// list of imported file names (ex: '_foo.sass', '_foo', etc) | ||
// list of imported file names (ex: 'foo.less', 'foo', etc) | ||
var dependencies = detective(content); | ||
``` | ||
|
||
### Related | ||
|
||
* [node-sass-lookup](https://github.com/dependents/node-sass-lookup) if you want to map a sass/scss dependency to a file on your filesystem. | ||
* [node-precinct](https://github.com/dependents/node-precinct) if you want to also support finding dependencies for JavaScript and other languages. | ||
|
||
### License | ||
|
||
MIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters