All Projects → babel-utils → babel-explode-module

babel-utils / babel-explode-module

Licence: MIT license
Serialize a module into an easier format to work with

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to babel-explode-module

Videoplayback Ios
Swift AVPlayer wrapper using the VIPER architecture. Currently a work in progress
Stars: ✭ 213 (+526.47%)
Mutual labels:  modules
quickjs es runtime
this is a wrapper library for the javascript runtime quickjs written in rust which works with modules, promises, async, await and much more
Stars: ✭ 43 (+26.47%)
Mutual labels:  modules
laravel-admin
Laravel Admin panel with theme , modules ,artisan commands and helper classess.Laravel admin boilerplate with theme and modules
Stars: ✭ 22 (-35.29%)
Mutual labels:  modules
Mod
Automated Semantic Import Versioning Upgrades
Stars: ✭ 217 (+538.24%)
Mutual labels:  modules
Lodash
A modern JavaScript utility library delivering modularity, performance, & extras.
Stars: ✭ 51,659 (+151838.24%)
Mutual labels:  modules
WHMCS-JSJ-API-Pay-Gateway
WHMCS 财务系统对接金莎云免签支付API(你们怎么用,与我无瓜好吧:)
Stars: ✭ 58 (+70.59%)
Mutual labels:  modules
Browserify
browser-side require() the node.js way
Stars: ✭ 13,929 (+40867.65%)
Mutual labels:  modules
dnnextensions
One solution. Multiple extensions. No pain. A collection of DNN modules and other extensions.
Stars: ✭ 36 (+5.88%)
Mutual labels:  modules
opensource
Collection of Open Source packages by Otherwise
Stars: ✭ 21 (-38.24%)
Mutual labels:  modules
CodeIgniter-HMVC
CodeIgniter 3.1.10 with Modular Extensions - HMVC and Whoops Error Handling Framework 2.5.0
Stars: ✭ 30 (-11.76%)
Mutual labels:  modules
Vuex Feature Scoped Structure
📈 Feature scoped Vuex modules to have a better organization of business logic code inside Vuex modules based on Large-scale Vuex application structures @3yourmind
Stars: ✭ 218 (+541.18%)
Mutual labels:  modules
Pax
The fastest JavaScript bundler in the galaxy.
Stars: ✭ 2,626 (+7623.53%)
Mutual labels:  modules
OregonCore-Modules
Modules made for Oregoncore
Stars: ✭ 18 (-47.06%)
Mutual labels:  modules
Minipack
📦 A simplified example of a modern module bundler written in JavaScript
Stars: ✭ 2,625 (+7620.59%)
Mutual labels:  modules
tcl-modules
A collection of pure Tcl, production-ready micro packages
Stars: ✭ 25 (-26.47%)
Mutual labels:  modules
Gitpkg
Publish packages as git tags
Stars: ✭ 208 (+511.76%)
Mutual labels:  modules
module-dependents
Get the list of npm modules that depend on the specified npm module.
Stars: ✭ 15 (-55.88%)
Mutual labels:  modules
generative-art
🌈🎨 Generative Art is the idea realized as genetic code of artificial events, as construction of dynamic complex systems able to generate endless variations. This is also a nuxt-module (@luxdamore/nuxt-canvas-sketch) - [three.js, tensorflow.js and gsap are not included].
Stars: ✭ 41 (+20.59%)
Mutual labels:  modules
pythonic
Python like utility functions for JavaScript: range, enumerate, zip and items.
Stars: ✭ 28 (-17.65%)
Mutual labels:  modules
StartupModules
Startup modules for ASP.NET Core.
Stars: ✭ 33 (-2.94%)
Mutual labels:  modules

babel-explode-module

Serialize a module into an easier format to work with

import {foo, bar} from "mod";

export default function() {
  // ...
}

const baz = 42,
      bat = class Bat {};

export {
  baz,
  bat
};

Creating this AST:

Program
  body:
    - ImportDeclaration
        specifiers:
          - ImportSpecifier
          - ImportSpecifier
    - ExportDefaultDeclaration
        declaration: FunctionDeclaration
    - VariableDeclaration
        declarations:
          - VariableDeclarator
          - VariableDeclarator
    - ExportNamedDeclaration
        specifiers:
          - ExportSpecifier
          - ExportSpecifier

Will be exploded to this:

{
  imports: [
    { kind: "value", local: "foo", external: "foo", source: "mod", loc: {...} },
    { kind: "value", local: "bar", external: "bar", source: "mod", loc: {...} },
  ],
  exports: [
    { local: "_default", external: "default", loc: {...} },
    { local: "baz", external: "baz", loc: {...} },
    { local: "bat", external: "bat", loc: {...} },
  },
  statements: [
    { type: "FunctionDeclaration" },
    { type: "VariableDeclaration", declarations: VariableDeclarator },
    { type: "VariableDeclaration", declarations: VariableDeclarator },
  ],
}

Serializes imports/exports to an easy to work with format

// input
import a, {b} from "mod";
import * as c from "mod";
export default function d() {}
export {e, f as g};
export {default as h} from "mod";
export * from "mod";
// output
{
  imports: [
    { kind: "value", local: "a", external: "a", source: "mod" },
    { kind: "value", local: "b", external: "b", source: "mod" },
    { kind: "value", local: "c", source: "d" },
  ],
  exports: [
    { local: "d", external: "d" },
    { local: "e", external: "e" },
    { local: "f", external: "g" },
    { local: "default", external: "g", source: "mod" },
    { source: "mod" },
  ]
}

Simplifies declarations to create 1 binding per statement (i.e. variables)

// input
function a() {}
var b,
    c;
// output (printed)
function a() {}
var b;
var c;

Splits export values away from their exports

// input
export function a() {}
export default function() {}
// output (printed)
function a() {}
var _default = function() {};
export {a};
export default _default;
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].