JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1134658
  • Score
    100M100P100Q195452F
  • License MIT

Parse sass files and extract a graph of imports

Package Exports

  • sass-graph

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (sass-graph) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Sass Graph

Parses sass and exposes a graph of dependencies

Install

Install with npm

npm install --save-dev sass-graph

Usage

Usage as a Node library:

$ node
> var sassGraph = require('./sass-graph');
undefined
> sassGraph.parseDir('tests/fixtures');
{ index: {,
    'tests/fixtures/a.scss': {
      imports: ['b.scss'],
      importedBy: [],
    },
    'tests/fixtures/b.scss': {
      imports: ['_c.scss'],
      importedBy: ['a.scss'],
    },
    'tests/fixtures/_c.scss': {
      imports: [],
      importedBy: ['b/scss'],
    },
  }}

Usage as a command line tool:

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

$ ./bin/sassgraph tests/fixtures tests/fixtures/a.scss -d
tests/fixtures/a.scss
tests/fixtures/b.scss
tests/fixtures/_c.scss

License

MIT © Lachlan Donald