npm.io
0.0.2 • Published 7 years ago

puffs

Licence
ISC
Version
0.0.2
Deps
3
Size
242 kB
Vulns
1
Weekly
0

puff

A package for ananysis file dependencies. Using precinct to do the file parsing jobs.

support:

  • .js, .ts (as precinct does)
  • .less, .sass
  • .vue

usage

npm i puffs
import { resolve } form 'path';
import { parse } from 'puffs';

const result = await parse(path.resolve('/path/to/file.vue'));

api

prase

parse the file path and its file dependencies.

returns:

  • maxDepth, max dependencies depth
  • flattenDependencyFilePaths, all file paths including the entry file itself
  • entry, dependencies tree from the entry
  • externals, externals node_module dependencies