All Projects → babel-utils → babel-collect-imports

babel-utils / babel-collect-imports

Licence: MIT License
Recursively collect all the internal and external dependencies from an entry point

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to babel-collect-imports

Webpack Babel Env Deps
Find dependencies to transpile with Babel.
Stars: ✭ 130 (+293.94%)
Mutual labels:  babel, dependencies
nuxt-interpolation
Nuxt.js module as directive for binding every link to catch the click event, and if it's a relative link router will push.
Stars: ✭ 38 (+15.15%)
Mutual labels:  internal, external
lint-deps
Lint for unused or missing dependencies in your node.js projects. Customize with plugins or configuration.
Stars: ✭ 48 (+45.45%)
Mutual labels:  dependencies, imports
Parse Comments
Parse JavaScript code comments. Works with block and line comments, and should work with CSS, LESS, SASS, or any language with the same comment formats.
Stars: ✭ 53 (+60.61%)
Mutual labels:  babel, parse
Babylon
PSA: moved into babel/babel as @babel/parser -->
Stars: ✭ 1,692 (+5027.27%)
Mutual labels:  babel, babylon
eslump
Fuzz testing JavaScript parsers and suchlike programs.
Stars: ✭ 56 (+69.7%)
Mutual labels:  parse, babylon
parse-function
(!! moved to tunnckoCore/opensource multi-package repository !!) 🔱 Parse a function into an object using espree, acorn or babylon parsers. Extensible through Smart Plugins.
Stars: ✭ 37 (+12.12%)
Mutual labels:  parse, babylon
LeagueReplayParser
C# library which can read some data from a .rofl file, and start a replay in the client. (no longer actively maintained)
Stars: ✭ 20 (-39.39%)
Mutual labels:  parse
node-starter-kit
Node.js / GraphQL project template pre-configured with TypeScript, PostgreSQL, login flow, transactional emails, unit tests, CI/CD workflow.
Stars: ✭ 76 (+130.3%)
Mutual labels:  babel
babel-plugin-transform-html-import-to-string
Turn HTML imports (and export from) into constant strings
Stars: ✭ 22 (-33.33%)
Mutual labels:  babel
ignite-reactjs
Projetos desenvolvidos em ReactJS durante a trilha de ReactJS do Ignite da Rocketseat. 💜🚀
Stars: ✭ 20 (-39.39%)
Mutual labels:  babel
CFX-BYPASS
Bypass it, you won't be Banned when playing cheats 2022
Stars: ✭ 18 (-45.45%)
Mutual labels:  external
babel-plugin-remove-test-ids
🐠 Babel plugin to strip `data-test-id` HTML attributes
Stars: ✭ 40 (+21.21%)
Mutual labels:  babel
pinus-parse-interface
parse interface to pinus-protobuf JSON
Stars: ✭ 25 (-24.24%)
Mutual labels:  parse
common-words
Updated list of the 100 most common words in the English language. Useful for excluding these words from arrays.
Stars: ✭ 13 (-60.61%)
Mutual labels:  parse
create-mithril-app
Sets up a mithril.js project with webpack
Stars: ✭ 20 (-39.39%)
Mutual labels:  babel
ExecutionMaster
Windows utility for intercepting process creation and assigning standard actions to program startup
Stars: ✭ 54 (+63.64%)
Mutual labels:  internal
muninn
With a simple, flexible and maintainable configuration file, you can parse html and output json according to the schema you specify.
Stars: ✭ 38 (+15.15%)
Mutual labels:  parse
starbase
⭐ Production-ready website boilerplate made with webpack 5, modern JS (via Babel 7) & Sass
Stars: ✭ 70 (+112.12%)
Mutual labels:  babel
hardhat-dependency-compiler
📦 Compile Solidity sources directly from NPM dependencies
Stars: ✭ 19 (-42.42%)
Mutual labels:  dependencies

babel-collect-imports

Recursively collect all the internal and external dependencies from an entry point

Install

yarn add babel-collect-imports

Usage

const { collectImportsSync } = require('babel-collect-imports');

let { internal, external } = collectImportsSync('path/to/entry.js');
// { internal: ['path/to/entry.js', 'path/to/import.js', 'path/to/other/import.js'],
//   external: ['lodash', 'react'] }

When it discovers an "internal" dependency (one that is not a node package), it will follow the import and continue collecting dependencies.

API

collectImportsSync(entry, parserOpts?, resolveOpts?)

  • entry should be a full file path
  • parserOpts is Babylon's options
  • resolveOpts is resolve's options

FAQ

How are "internal" vs "external" imports determined?

It's all about the starting dot:

import internal from './internal-because-it-starts-with-a-dot';
import external from 'external-because-it-does-not-start-with-a-dot';

What about my special aliasing system?

Your custom aliasing is bad and you should feel bad. Try playing with resolveOpts.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].