hactar-auto-install
v0.0.51
Published
A Hactar plugin that automatically installs required modules.
Downloads
13
Readme
Hactar Auto Installer
This plugin for Hactar takes your JavaScript, scans it for import statements and then automatically installs dependencies. It doesn't use things like Webpack loaders. It parses your JavaScript directly and npm installs anything that is missing.
Installation
First install Hactar:
$ npm install -g hactar
Then run:
$ hactar --plugins hactar-auto-install
Go read up on Hactar for more details
Usage
Just run hactar:
$ hactar
And everything happens automatically :)
Using it in another hactar plugin
Like all Hactar plugins, this one exports a saga, an ES6 generator that looks like this:
function* saga(action, ch) {
parseImports(action)
}
You can use it like this:
import { saga as autoInstaller } from 'hactar-auto-install'
function* customPlugin(action, ch) {
yield autoInstaller(action, ch)
}
See the building a plugin docs for more examples and details
Using it in a custom config file
If you have a custom Hactar config file (hactar.config.js
) you can load the plugin like this:
import autoInstaller from 'hactar-auto-install'
const plugins = [ autoInstaller ]
export { plugins }
See the customization docs for more examples and details
Support
If you found this repo useful please consider supporting me on Gratipay, sending me some bitcoin 1csGsaDCFLRPPqugYjX93PEzaStuqXVMu
, or giving me lunch money via Cash.me/$k2052 or paypal.me/k2052