0.0.1 • Published 5 years ago

dependencies-trace v0.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

Parse dependencies

Greenkeeper badge NPM Version Build Status Test Coverage

Find your code dependencies, supports typescript, javascript and coffe script

Dependencies trace

A simple and naive approach to trace your code dependecies. It's very fast and uses only a single regex execution per file.

Motivation

While the correct way to trace dependecies is by using some sort of AST analyzer this will require more computions then using a single regex execution per file.

dependencies-trace was built for performance over accuracy and it's doing best effort to find all dependencies of your file. If you find scenarios that dependencies-trace couldn't find your dependencies - open an issue in the github repo and I will do my best effort to fix it.

Simple to use

  const {tsImports,coffeImports} = require('dependencies-trace');
  
  const tsExample = `
  import { ZipCodeValidator as ZCV } from "./ZipCodeValidator";
  `
  const coffeExample = `
    const {a} = require "jquery";
  `

  console.log(tsImports(tsExample));
  //-> ./ZipCodeValidator
   console.log(coffeImports(coffeExample));
  //-> jquery

License

MIT