All Projects â†’ requirex â†’ requirex

requirex / requirex

Licence: MIT license
A different kind of module loader 📊🊖

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to requirex

Neuron.js
A Full Feature CommonJS Module Manager, Dependency Graph Handler and Loader for Browsers
Stars: ✭ 66 (+230%)
Mutual labels:  bundler, loader
Fuse Box
A blazing fast js bundler/loader with a comprehensive API 🔥
Stars: ✭ 4,055 (+20175%)
Mutual labels:  bundler, loader
Fileloader
A library for managing file downloads on the Android platform
Stars: ✭ 27 (+35%)
Mutual labels:  loader
spinners-angular
Lightweight SVG/CSS spinners for Angular
Stars: ✭ 21 (+5%)
Mutual labels:  loader
systemjs-riot
jspm/systemjs plugin to load RiotJS tags and inline them in the bundle
Stars: ✭ 18 (-10%)
Mutual labels:  systemjs
luacc
Lua Code Combine
Stars: ✭ 36 (+80%)
Mutual labels:  loader
favloader
Vanilla JavaScript library for loading animation in favicon (favicon loader)
Stars: ✭ 20 (+0%)
Mutual labels:  loader
sizeof-loader
Webpack loader that works like url-loader (or file-loader) but with extracted information such as image dimensions and file-size.
Stars: ✭ 20 (+0%)
Mutual labels:  loader
babel-plugin-rewire-exports
Babel plugin for stubbing [ES6, ES2015] module exports
Stars: ✭ 62 (+210%)
Mutual labels:  systemjs
image-minimizer-webpack-plugin
Webpack loader and plugin to compress images using imagemin
Stars: ✭ 180 (+800%)
Mutual labels:  loader
gdmod
A mod loader and modding API for GDevelop games.
Stars: ✭ 15 (-25%)
Mutual labels:  loader
importtool
General data import tool for IgorPro
Stars: ✭ 19 (-5%)
Mutual labels:  loader
loading
Laravel package to add loading indicator to pages while page is loading.
Stars: ✭ 38 (+90%)
Mutual labels:  loader
elfloader
ARMv7M ELF loader
Stars: ✭ 71 (+255%)
Mutual labels:  loader
wparcel
A webpack-based parcel-like web application bundler
Stars: ✭ 45 (+125%)
Mutual labels:  bundler
ex loader
Load a single beam file, apps (a set of beams), or an erlang release (a set of apps) to a node.
Stars: ✭ 12 (-40%)
Mutual labels:  loader
vkel
Simple Dynamic Vulkan Extension Loader
Stars: ✭ 39 (+95%)
Mutual labels:  loader
jsx-compress-loader
⚛JSX optimisation loader to reduce size of React application
Stars: ✭ 40 (+100%)
Mutual labels:  loader
ngx-translate-module-loader
Highly configurable and flexible translations loader for @ngx-translate/core
Stars: ✭ 31 (+55%)
Mutual labels:  loader
adonis-bundler
Blazing fast, zero configuration assets bundler for AdonisJS
Stars: ✭ 19 (-5%)
Mutual labels:  bundler

npm version Travis status AppVeyor status dependency status

RequireX

requirex is a small install size, free license, tightly coded and opinionated toolchain replacing npm and webpack. It runs entirely on your own machine in the browser, or in Node.js. It saves lots of both time and disk space.

It removes unnecessary complexity from modern JavaScript development, making it easy to start new projects and test ideas. There's no need to install or configure anything to start coding. You can even use npm packages without having Node.js.

For the quickest start, see the optional instant online project creatorTODO (you can continue development locally and offline).

Basic idea

If you write:

import React from 'react';

requirex guesses it's ES6 or TypeScript and wants the latest react from npm. So it fetches React (unless already installed locally using npm) from UNPKG or jsDelivr and transpiles your code using the TypeScript compiler (also works for ES6, much like Babel).

If the compiler is not installed locally, it fetches that too. Any npm package can be imported in the same way and generally obvious, manual tooling steps in JavaScript development have been automated away to save your time and effort.

There's lots of automatic ✹ magic ✹ inside to make it run smooth and fast: caching, bundling, module resolution, transpiling, AMD / CommonJS support, source maps, isomorphic fetch... So read on:

Table of contents

Skip Webpack

requirex is a radical change to JavaScript development philosophy. Compare:

requirex
  • You write code.
  • Code runs.
  • Dependencies are downloaded as needed.
  • Configuration is generated.
  • You may edit configuration or run a bundler.
webpack
  • You must start with configuration.
  • Dependencies are installed.
  • You write code.
  • You must run a bundler or watch task.
  • Code runs.

Automating the common development steps gets you started faster. If the project grows more complex, you can switch to Webpack later without wasting any effort spent because requirex can automatically generate compatible configuration files for npm or TODOWebpack.

requirex allows you to learn, test and validate ideas faster.

Getting started

Online quickstart

Open the project creatorTODO, follow instructions and publish an app or download a self-hosted project (even without Node.js) as a .zip or tarball.

Locally in the browser

If you already have a web server, a single index.html file inside it (download example) is enough to run some code.

Otherwise, you can download serve.bat (a simple web server for Linux, Windows and OS X), run it and put an index.html file in the same directory, then open http://localhost:8080/ to see the result.

In index.html (download full example), first include requirex on the page:

<script src="https://cdn.jsdelivr.net/npm/requirex"></script>

Then use it to load your own code with a script element using a special type attribute:

<script type="x-req-application/javascript" src="app.js"></script>

Or more explicitly using vanilla JavaScript:

<script>

System.import('./app.js');

</script>

You can also write ES6 or TypeScript directly inside the script element:

<script type="x-req-application/javascript">

import React from 'react';
import ReactDOM from 'react-dom';

const element = <h1>Hello, World!</h1>;

ReactDOM.render(element, document.body);

</script>

You can use the project creatorTODO and download a self-hosted project with a web server included and ready to go (even without Node.js).

Locally in Node.js

You can install requirex like so:

npm install --save requirex

Then use it from the command line:

npx requirex app.js

or without npx:

node -e "require('requirex').System.import('./app.js')"

or from JavaScript code:

var System = require('requirex').System;

System.import('./app.js');

on in package.json scripts:

"scripts": {
  "start": "requirex app.js"
}

Now app.js can contain ES6 or TypeScript code and successfully import packages even if they haven't been installed, like this:

import pad from 'left-pad';

console.log(pad('foo', 42));

Here's a one-liner to test it immediately:

npx requirex -e "console.log(require('left-pad')('foo', 42));"

or without npx:

node -e "require('requirex').System.import('left-pad').then(function(pad) { console.log(pad('foo', 42)); })"

Practical issues

Changing package versions can cause problems later, so requirex can read, generate and update package.json and package-lock.json files. That keeps the project always compatible with other development tools. If you want to keep using npm then requirex will use any installed packages, but you can also try out new packages without having to install them. Generating new npm configuration ensures used packages will have correct version numbers and unused packages are dropped.

Loading dependencies and transpiling code every time is slow, so requirex will store results in window.caches, window.localStorage or the local filesystem, whichever it can access.

Other users still need to download everything the first time, so requirex can bundle and minify all dependencies into a single file making it load faster.

License

The MIT License

Copyright (c) 2018- RequireX authors, see doc/AUTHORS

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