hastyjs
v0.0.7
Published
experiment quickly with javascript without node modules
Downloads
6
Maintainers
Readme
Hastyjs👩💻
Hastyjs is the cli tool for you if you quickly want to add npm libraries to your experimental javascript project.
Hastyjs internally uses custom esbuild plugins to fetch bundled versions of javascript libraries from unpkg.com on demand and bundles them alongside your local modules.
This tool is not meant to replace your traditional node js production pipeline but to allow you to quickly experiment with your ideas without the need for a package.json file and node modules.
Features
- Harnesses Esbuild's speed ⚡⚡⚡ bundling capabilities
- Caches fetched libraries for faster execution
- Use popular libraries such as lodash without
npm install
- Execute complex javascript code with a simple command
Installation
Installing Hastyjs with npm
npm install -g hastyjs
Usage
hastyjs run --input=<EntryFile> | -i <EntryFile> --output=<OutputFile> | -i <OutputFile>
-> EntryFile is the entry file passed to esbuild for bundling - default=index.js
-> OutputFile is the file bundled file - default=output.js
hastyjs clear-cache
-> Clears cache
Examples
//index.js
import _ from 'lodash';
console.log(_.merge({ java: '13', cpp: '32', rust: '23' }));
hastyjs run --input=index.js --output=output.js && node output.js
✅✅✅ bundle successful
{ java: '13', cpp: '32', rust: '23' }
//clears cache
hastyjs clear-cache
Credits
- Several references were made from Stephen Griders React with Typescript course on Udemy
Contributing
Contributions are always welcome!
See contributing.md
for ways to get started.