Giter Club home page Giter Club logo

lumpy's Introduction

๐Ÿ‘พ lumpy

npm version CircleCI codecov.io JavaScript Style Guide

A lumpy and dummy JavaScript module bundler for those who are stuck in the past

Lumpy logo

๐Ÿ’ฝ Install

As usual in 2018, most of the software is installed through npm, this one makes no difference:

npm install --global lumpy

Be sure to have node >= 8.0.0.

At this point you should be able to run the lumpy executable. Try it with:

lumpy --help

๐Ÿ’พ Precompiled binaries

Alternatively, you can install lumpy by downloading one of the precompiled executables available for Windows, Linux or Mac in the releases page.

๐Ÿฆ” Usage

Lumpy helps you to build a JavaScript bundle file for your frontend applications dependencies starting from a lumpy file (lumpy.txt).

A lumpy file is a plain text file that contains a list of the URLS of all your dependencies. An example lumpy.txt looks as follows:

# lumpy.txt
https://unpkg.com/[email protected]/dist/zepto.min.js
https://unpkg.com/[email protected]/dist/uuid.core.js
https://unpkg.com/[email protected]/dist/store2.min.js
https://unpkg.com/[email protected]/dist/tippy.all.min.js
https://unpkg.com/[email protected]/dist/index.min.js
https://unpkg.com/[email protected]/lib/main.js
https://unpkg.com/[email protected]/favico-0.3.10.min.js

A lumpy file can contain only URLs and comments. A comments is a line starting with #. Separate URLs need to be in separate lines. You can have as many empty lines as you want.

Inside your project, once you create your lumpy.txt file, listing all the dependencies for your frontend application, you can create a single compiled file containing all of them with the following command:

lumpy build

This will output the built package in vendor.js. This file will contain the code contained in all the URLs specified in your lumpy.txt file (in the same order). By default the resulting JavaScript file will be minified using babel-minify.

๐Ÿ˜ฑ Advanced usage

The lumpy executable offers 3 main sub-commands:

  • build: creates a build package from a lumpy.txt file
  • clear-cache: clears the cache folder
  • --help: display the help for the main executable or a subcommand (lumpy [build | clear-cache] --help)

๐Ÿ“ฆ Build

The build command allows you to build a vendors package from a lumpy.txt file.

Usage:

lumpy build [destFile]

Where destFile is the path of the compiled bundle file (by default it will be vendors.js in the current working directory).

Options:

  • --lumpyFile, -l [file]: (optional) the lumpy file to use. By default it will check for a lumpy.txt file in the current working directory
  • --cacheFolder, -c [path]: (optional) the path to a folder where the cache files are stored. By default it will create a .lumpy-cache directory in your user home directory.
  • --noMinify, -M: (optional) if set it won't minify the resulting vendors bundle file.
  • --noCache, -C: (optional) if set it won't try to use the cache
  • --stdout, -o: (optional) if set it will output the resulting bundle in the standard output instead of a doing that on a file. Useful if you want to pipe the resulting content to another command.

๐Ÿ›€๐Ÿฟ Clear cache

Clear the cache folder deleting all the previously downloaded files.

Usage:

lumpy clear-cache

Options:

  • --cacheFolder, -c [path]: (optional) the path to a folder where the cache files are stored. By default it will create a .lumpy-cache directory in your user home directory.

๐Ÿ‘ฏโ€ Contributing

Everyone is very welcome to contribute to this project. You can contribute just by submitting bugs or suggesting improvements by opening an issue on GitHub.

๐Ÿคฆโ€ License

Licensed under MIT License. ยฉ Luciano Mammino.

lumpy's People

Contributors

lmammino avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.