All Projects → iggredible → bandler

iggredible / bandler

Licence: other
The Simple JS Module Bundler

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to bandler

Framer-CollectionComponent
Framer Module
Stars: ✭ 22 (+29.41%)
Mutual labels:  module
lovedebug
A fixed and updated repo of LOVEDEBUG
Stars: ✭ 22 (+29.41%)
Mutual labels:  module
breaker
🚧 Flexible mechanism to make execution flow interruptible.
Stars: ✭ 100 (+488.24%)
Mutual labels:  module
google streetview
A command line tool and module for Google Street View Image API
Stars: ✭ 77 (+352.94%)
Mutual labels:  module
react-native-tab-navigator
JavaScript for React-Native iOS Android module
Stars: ✭ 35 (+105.88%)
Mutual labels:  module
vuex-module-generator
abdullah.github.io/vuex-module-generator
Stars: ✭ 89 (+423.53%)
Mutual labels:  module
HumHub-WeChat
Its a chat widget for admins and moderators You can use from HumHub Admin Panel - it is working with latest HumHub.
Stars: ✭ 14 (-17.65%)
Mutual labels:  module
the-super-tiny-web-module-resolver
simple js bundler written in 100 lines of code.
Stars: ✭ 25 (+47.06%)
Mutual labels:  module
SCF4-SDK
Motorized zoom lens controller Kurokesu SCF4 module featuring STM32 controller and Onsemi LC898201 driver control software
Stars: ✭ 14 (-17.65%)
Mutual labels:  module
laravel-module-loader
THIS PACKAGE HAS BEEN DEPRECATED — A lightweight package to organize your code into contextual modules.
Stars: ✭ 76 (+347.06%)
Mutual labels:  module
PoShLog
🔩 PoShLog is PowerShell cross-platform logging module. It allows you to log structured event data into console, file and much more places easily. It's built upon great C# logging library Serilog - https://serilog.net/
Stars: ✭ 108 (+535.29%)
Mutual labels:  module
nuxt-modules
AX2's Nuxt modules
Stars: ✭ 30 (+76.47%)
Mutual labels:  module
vue-component-creator-plugin
Simplify your frontend dev by automatically created vue components and vuex modules
Stars: ✭ 16 (-5.88%)
Mutual labels:  module
wulaphp
一个有点复杂的PHP框架!
Stars: ✭ 26 (+52.94%)
Mutual labels:  module
modules
Officially supported Revel modules
Stars: ✭ 46 (+170.59%)
Mutual labels:  module
ngx http hmac secure link module
HMAC Secure Link module for NGINX.
Stars: ✭ 47 (+176.47%)
Mutual labels:  module
laravel-module
Module management package for Laravel
Stars: ✭ 65 (+282.35%)
Mutual labels:  module
whichpm
Locates installed Perl modules.
Stars: ✭ 20 (+17.65%)
Mutual labels:  module
puppetlabs-limits
Module for managing pam limits in /etc/security/limits.conf
Stars: ✭ 14 (-17.65%)
Mutual labels:  module
node-advanced
Node Advanced Courseware
Stars: ✭ 80 (+370.59%)
Mutual labels:  module

bandler

The simple Javascript module bundler. Capable of bundling simple CJS or ESM modules.

Why did I create this?

At work we use webpack and I use rollup for personal use. Up to this point, much of the bundling process is rather magical. You tell them where the entry is, designate output, and poof! Your code is automagically bundled.

I created this project mainly to teach myself how bundler works. My hope is that others could understand how bundlers work from this project.

This project is inspired by minipack and wbpck-bundler, both of which accomplishes similar things. In case you're wondering, the main difference is that minipack bundles ES6 and wbpck-bundler bundles CJS. Bandler attempts to bundle both CJS and ES6 without additional config from user.

With that being said, this project is not production-ready. This is not a webpack/ rollup replacement. This is a toy bundler 🎁. You have been warned.

Code explanation

I wrote an article explaining the code. You should check it out!

Usage

Run node ./bandler.js /direction/to/entry.js

  1. Install dependencies: npm i

  2. This project has 2 examples: ./example1/entry.js uses ES6 modules and ./example2/entry.js uses CJS modules

  3. Run either entries, for example: node ./bandler.js ./example2/entry.js

It will output the bundled code on terminal, such as this:

(function(modules){
  const require = id => {
    const {factory, map} = modules[id];
    const localRequire = requireDeclarationName => require(map[requireDeclarationName]);
    const module = {exports: {}};

    factory(module, localRequire);
    return module.exports;
  }
  require(0);
})({0: {
    factory: (module, require) => {
      const module1 = require('./module1.js');

      module1();

    },
    map: {"./module1.js":1}
  },1: {
    factory: (module, require) => {
      "use strict";

      var module1 = function module1() {
      console.log("Hello from module1!");
  };

      module.exports = module1;
    },
    map: {}
}})

The code above is a bundled code from example2 entry and all its dependencies. Copy/paste the code on your browser console to see the code above works (disclaimer: it is just console.log).

Contributing

If you think this project could be made clearer/ better/ found bugs, please feel free to submit PRs.

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].