4.0.1 • Published 2 years ago

sass-graph v4.0.1

Weekly downloads
5,072,464
License
MIT
Repository
github
Last release
2 years ago

Sass Graph

Parses Sass files in a directory and exposes a graph of dependencies

Build Status Coverage Status npm version Dependency Status devDependency Status

Install

Install with npm

npm install --save-dev sass-graph

Usage

Usage as a Node library:

var sassGraph = require('./sass-graph');

Usage as a command line tool:

The command line tool will parse a graph and then either display ancestors, descendents or both.

$ ./bin/sassgraph --help
Usage: bin/sassgraph <command> [options] <dir> [file]

Commands:
  ancestors    Output the ancestors
  descendents  Output the descendents

Options:
  -I, --load-path   Add directories to the sass load path
  -e, --extensions  File extensions to include in the graph
  -j, --json        Output the index in json
  -h, --help        Show help
  -v, --version     Show version number

Examples:
  ./bin/sassgraph descendents test/fixtures test/fixtures/a.scss
  /path/to/test/fixtures/b.scss
  /path/to/test/fixtures/_c.scss

API

parseDir

Parses a directory and builds a dependency graph of all requested file extensions.

parseFile

Parses a file and builds its dependency graph.

Options

loadPaths

Type: Array Default: [process.cwd]

Directories to use when resolved @import directives.

extensions

Type: Array Default: ['scss', 'sass']

File types to be parsed.

follow

Type: Boolean Default: false

Follow symbolic links.

exclude

Type: RegExp Default: undefined

Exclude files matching regular expression.

Example

var sassGraph = require('./sass-graph');
console.log(sassGraph.parseDir('test/fixtures'));

//{ index: {,
//    '/path/to/test/fixtures/a.scss': {
//        imports: ['b.scss'],
//        importedBy: [],
//    },
//    '/path/to/test/fixtures/b.scss': {
//        imports: ['_c.scss'],
//        importedBy: ['a.scss'],
//    },
//    '/path/to/test/fixtures/_c.scss': {
//        imports: [],
//        importedBy: ['b/scss'],
//    },
//}}

Running Mocha tests

You can run the tests by executing the following commands:

npm install
npm test

Authors

Sass graph was originally written by Lachlan Donald. It is now maintained by Michael Mifsud.

License

MIT

node-sassnode-sass-chokidar-wxss@ymatuhin/uraniumbb-chat@olivervorasai/slidernode-sass-win32-x64-n4-n5-binnode-sass-linux-win32-x64-n4-n5-bin@infinitebrahmanuniverse/nolb-sas@saaspe/componentsexpand-react-bridge@everything-registry/sub-chunk-2710wc-starterkitvue-compment@greminder/bootstrap-material-design@luaeb/assetsfis-msprd-node-sass_4_1_1fis-msprd-node-sass_4_2_0fis-msprd-node-sass_4_3_0@kristoffertonning/vue-laravel-errors@leeight/node-sass-chokidarfhir2@npmtuanmap2024/eveniet-consectetur-fuga-magni@omneedia/node-sassgrunt-dependent-stylesg2a-node-sass@ngxvoice/ngx-voicelistnerelectricityes-react-bridge@runforest/node-sass-watchericons-vue-testeasy-elementemr-tabulator-tables@jmilanes/hotbars@paulcbetts/node-sassgulp-better-sass-inheritance@orbit-tech/sass-unused-recursivegulp-cached-sassgulp-sass-graphergulp-sass-inheritancegulp-sass-inheritance-independergulp-sass-inheritance-plusgulp-sass-multi-inheritancegulp-sass-parentgulp-sass-partials-importedgulp.sass@ericmcornelius/ease@spearhook/plugin-scss@farvater/open-pedigreekiki-bundler@thezebra/sass-affected@trmediaab/tr-node-sass-chokidar@ssossou/styletool@formanta/build-task.sassbaro_css_styledbeelinejs-todo-mvcatlas-guidenes-node-sass-prebuiltng2-template-libsnode-yang-testmrmix@amoo-miki/node-sassacetonemd-vditor@classyllama/bigcommerce-node-sassnode-sass-chinanode-sass-chokidarnode-sass-macnode-sass-prebuiltnode-sass-vendornode-sass-watchernode-sass-with-bindingsnode-sass-wittibsnode-sass-x64node-sass.jsnode-sass-tempnode-sass-testnode-sass-hellanode-scssnd-node-sassless-incremental-builder@wuhuu233/node-sass-china@vitali_shcherbina/styled-lib@agilo/sass-watcher@dinert/echartspanther-enginecustom-gulp-sass-inheritancepostasscom.tqniyati.nfc.nfcpluginnuxtjs-argondevez-node-sassdigital-keyboard-demosreact-solid-gradient-pickerselect2-selectallsass-carbon-copysass-loader-syncsass-makedependsass-graph-vizsass-embedded-clistyletools@castrum-nubis/bulma
4.0.1

2 years ago

4.0.0

2 years ago

3.0.5

4 years ago

2.2.6

4 years ago

2.2.5

4 years ago

3.0.4

5 years ago

3.0.3

6 years ago

3.0.2

6 years ago

3.0.1

6 years ago

3.0.0

6 years ago

2.2.4

7 years ago

2.2.3

7 years ago

2.2.2

7 years ago

2.2.1

7 years ago

2.2.0

7 years ago

2.1.2

8 years ago

2.1.1

8 years ago

2.1.0

8 years ago

2.0.1

9 years ago

2.0.0

9 years ago

1.3.0

9 years ago

1.2.0

9 years ago

1.1.0

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago