@spine/bootstrap

A bootstrap standard for your project

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
Minified + gzip package size for @spine/bootstrap in KB

Readme

Spine Bootstrap

This module will make sure your entire project is pluggable.

This is an additional dependency for Spine Hook

Usage

Create your hook

# myPlugin.ts
import {
  bootstrapHook,
  initHook,
  deathHook,
} from '@spine/bootstrap';

bootstrapHook.addAction('your-plugin', () => {
  /* This is an opportunite to bind or unbind any plugin */
  console.log('bootstrap');
});

initHook.addAction('your-plugin', async () => {
  /* Initialize something  */
  console.log('executed after bootstrap hook');
});

deathHook.addAction('your-plugin', async () => {
  /* It will execute when window unloads or process is killed */
  console.log('destroy');
});

Bootstrap your project

# index.ts
import { bootstrap } from '@spine/bootstrap/server';

// load your plugins
import './myPlugin';

bootstrap()
  .catch(error => console.log(error.stack || error.message));

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.