hactar-auto-install

0.0.51 • Public • Published

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.

Imgur

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

Readme

Keywords

Package Sidebar

Install

npm i hactar-auto-install

Weekly Downloads

0

Version

0.0.51

License

ISC

Last publish

Collaborators

  • k2052