@slimio/bundler
Version:
SlimIO Archive (Addon & Core) Bundler
83 lines (62 loc) • 2.9 kB
Markdown
# bundler

[](https://github.com/SlimIO/bundler/commit-activity)



[](https://snyk.io//test/github/SlimIO/bundler?targetFile=package.json)
[](https://travis-ci.com/SlimIO/bundler)
SlimIO Archive bundler & Core compiler.
## Requirements
- [Node.js](https://nodejs.org/en/) v12 or higher
## Getting Started
This package is available in the Node Package Repository and can be easily installed with [npm](https://docs.npmjs.com/getting-started/what-is-npm) or [yarn](https://yarnpkg.com).
```bash
$ npm i @slimio/bundler
# or
$ yarn add @slimio/bundler
```
## Usage example
TBC
## API
<details><summary>generateAddonArchive(location: string, options?: ArchiveOptions): Promise< string ></summary>
<br />
Create Addon archive.
```js
const { generateAddonArchive } = require("@slimio/bundler");
generateAddonArchive("F:\\Code\\Agent\\addons\\alerting", {
debug: true
}).catch(console.error);
```
</details>
<details><summary>generateCoreExecutable(location: string, options?: CoreOptions): Promise< string ></summary>
<br />
Compile the core. Options is described by the following interface
```ts
interface CoreOptions {
debug?: boolean;
cwd?: string;
}
```
```js
const { generateCoreExecutable } = require("@slimio/bundler");
const { join } = require("path");
generateCoreExecutable("F:\\Code\\AgentTest", {
debug: true,
cwd: join(__dirname, "build")
});
}).then(() => console.log("core compiled")).catch(console.error);
```
</details>
## Dependencies
|Name|Refactoring|Security Risk|Usage|
|---|---|---|---|
|[@slimio/arg-checker](https://github.com/SlimIO/bundler)|Minor|Low|Argument Checker|
|[@slimio/is](https://github.com/SlimIO/is#readme)|Minor|Low|Type checker|
|[@slimio/manifest](https://github.com/SlimIO/Manifester#readme)|Minor|Low|SlimIO manifest|
|[@slimio/tarball](https://github.com/SlimIO/Tarball)|⚠️Major|High|SlimIO Addon & module archive tarball packer/extractor|
|[get-dir-size](https://github.com/fraxken/dir-size#readme)|Minor|Low|Get a directory size|
|[nexe](https://github.com/nexe/nexe#readme)|⚠️Major|High|Create Node.js executable|
|[pretty-bytes](https://github.com/sindresorhus/pretty-bytes#readme)|Minor|Low|Displaying file sizes for humans|
## License
MIT