3 Parses Sass files in a directory and exposes a graph of dependencies
5 [![Build Status](https://travis-ci.org/xzyfer/sass-graph.svg?branch=master)](https://travis-ci.org/xzyfer/sass-graph)
6 [![npm version](https://badge.fury.io/js/sass-graph.svg)](http://badge.fury.io/js/sass-graph)
7 [![Dependency Status](https://david-dm.org/xzyfer/sass-graph.svg?theme=shields.io)](https://david-dm.org/xzyfer/sass-graph)
8 [![devDependency Status](https://david-dm.org/xzyfer/sass-graph/dev-status.svg?theme=shields.io)](https://david-dm.org/xzyfer/sass-graph#info=devDependencies)
12 Install with [npm](https://npmjs.org/package/sass-graph)
15 npm install --save-dev sass-graph
20 Usage as a Node library:
23 var sassGraph = require('./sass-graph');
26 Usage as a command line tool:
28 The command line tool will parse a graph and then either display ancestors, descendents or both.
31 $ ./bin/sassgraph --help
32 Usage: bin/sassgraph <command> [options] <dir> [file]
35 ancestors Output the ancestors
36 descendents Output the descendents
39 -I, --load-path Add directories to the sass load path
40 -e, --extensions File extensions to include in the graph
41 -j, --json Output the index in json
43 -v, --version Show version number
46 ./bin/sassgraph descendents test/fixtures test/fixtures/a.scss
47 /path/to/test/fixtures/b.scss
48 /path/to/test/fixtures/_c.scss
55 Parses a directory and builds a dependency graph of all requested file extensions.
59 Parses a file and builds its dependency graph.
66 Default: `[process.cwd]`
68 Directories to use when resolved `@import` directives.
73 Default: `['scss', 'css']`
75 File types to be parsed.
80 var sassGraph = require('./sass-graph');
81 console.log(sassGraph.parseDir('test/fixtures'));
84 // '/path/to/test/fixtures/a.scss': {
85 // imports: ['b.scss'],
88 // '/path/to/test/fixtures/b.scss': {
89 // imports: ['_c.scss'],
90 // importedBy: ['a.scss'],
92 // '/path/to/test/fixtures/_c.scss': {
94 // importedBy: ['b/scss'],
99 ## Running Mocha tests
101 You can run the tests by executing the following commands:
110 Sass graph was originally written by [Lachlan Donald](http://lachlan.me).
111 It is now maintained by [Michael Mifsud](http://twitter.com/xzyfer).