# np-pack-cli

Latest version **2.5.1** (published 2025-02-11) · ISC license · 0 weekly downloads

## Install

```sh
npm install np-pack-cli
pnpm add np-pack-cli
yarn add np-pack-cli
bun add np-pack-cli
```

Provides the command `pack`.

## Health

**Score 25/100 (F)** — status: maintenance-mode.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.5.1 |
| Published | 2025-02-11 |
| First published | 2019-10-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 39 |
| Unpacked size | 34.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | chante |

## Links

- npm: https://www.npmjs.com/package/np-pack-cli
- Repository: https://github.com/chanteP/np-pack-cli
- Homepage: https://github.com/chanteP/np-pack-cli#readme
- Issues: https://github.com/chanteP/np-pack-cli/issues
- npm.io page: https://npm.io/package/np-pack-cli

## Dependencies (39)

- [vue](https://npm.io/package/vue.md) ^3.5.13
- [mime](https://npm.io/package/mime.md) ^3.0.0
- [sass](https://npm.io/package/sass.md) ^1.84.0
- [chalk](https://npm.io/package/chalk.md) ^2.4.2
- [core-js](https://npm.io/package/core-js.md) ^3.20.3
- [webpack](https://npm.io/package/webpack.md) 5
- [fs-extra](https://npm.io/package/fs-extra.md) ^10.0.0
- [commander](https://npm.io/package/commander.md) ^3.0.2
- [ts-loader](https://npm.io/package/ts-loader.md) ^9.5.2
- [css-loader](https://npm.io/package/css-loader.md) ^3.2.0
- [raw-loader](https://npm.io/package/raw-loader.md) ^4.0.2
- [typescript](https://npm.io/package/typescript.md) ~5
- [url-loader](https://npm.io/package/url-loader.md) ^4.1.1
- [vue-loader](https://npm.io/package/vue-loader.md) ^17.4.2
- [@babel/core](https://npm.io/package/@babel/core.md) ^7.16.7
- [file-loader](https://npm.io/package/file-loader.md) ^6.2.0
- [html-loader](https://npm.io/package/html-loader.md) ^0.5.5
- [sass-loader](https://npm.io/package/sass-loader.md) ^12.4.0
- [babel-loader](https://npm.io/package/babel-loader.md) ^9.2.1
- [style-loader](https://npm.io/package/style-loader.md) ^1.0.0
- [assemblyscript](https://npm.io/package/assemblyscript.md) ^0.20.16
- [babel-polyfill](https://npm.io/package/babel-polyfill.md) ^6.26.0
- [@vue/runtime-dom](https://npm.io/package/@vue/runtime-dom.md) ^3.2.40
- [reflect-metadata](https://npm.io/package/reflect-metadata.md) ^0.1.13
- [@babel/preset-env](https://npm.io/package/@babel/preset-env.md) ^7.16.8
- [@vue/compiler-sfc](https://npm.io/package/@vue/compiler-sfc.md) ^3.2.28
- [@babel/preset-react](https://npm.io/package/@babel/preset-react.md) ^7.0.0
- [regenerator-runtime](https://npm.io/package/regenerator-runtime.md) ^0.13.9
- [terser-webpack-plugin](https://npm.io/package/terser-webpack-plugin.md) ^5.3.11
- [webpack-bundle-analyzer](https://npm.io/package/webpack-bundle-analyzer.md) ^4.5.0
- [@babel/preset-typescript](https://npm.io/package/@babel/preset-typescript.md) ^7.16.7
- [@babel/plugin-proposal-decorators](https://npm.io/package/@babel/plugin-proposal-decorators.md) ^7.8.3
- [@babel/plugin-proposal-function-sent](https://npm.io/package/@babel/plugin-proposal-function-sent.md) ^7.8.3
- [@babel/plugin-proposal-class-properties](https://npm.io/package/@babel/plugin-proposal-class-properties.md) ^7.8.3
- [@babel/plugin-proposal-numeric-separator](https://npm.io/package/@babel/plugin-proposal-numeric-separator.md) ^7.8.3
- [@babel/plugin-proposal-optional-chaining](https://npm.io/package/@babel/plugin-proposal-optional-chaining.md) ^7.8.3
- [@babel/plugin-proposal-throw-expressions](https://npm.io/package/@babel/plugin-proposal-throw-expressions.md) ^7.8.3
- [@babel/plugin-proposal-export-namespace-from](https://npm.io/package/@babel/plugin-proposal-export-namespace-from.md) ^7.8.3
- [@babel/plugin-proposal-nullish-coalescing-operator](https://npm.io/package/@babel/plugin-proposal-nullish-coalescing-operator.md) ^7.8.3

## Recent versions

- 2.5.1 (latest) — 2025-02-11
- 2.5.0 — 2025-02-11
- 2.4.3 — 2024-07-04
- 2.4.2 — 2024-06-25
- 2.4.1 — 2024-06-25
- 2.4.0 — 2024-06-25
- 2.3.7 — 2024-06-20
- 2.3.6 — 2024-04-16
- 2.3.5 — 2023-11-28
- 2.3.4 — 2023-11-01
- 2.3.3 — 2023-10-12
- 2.3.2 — 2023-10-12
- 2.3.1 — 2023-10-09
- 2.3.0 — 2023-09-14
- 2.2.8 — 2023-05-09
- … 34 more at https://npm.io/package/np-pack-cli/versions

## README

# 自用 pack

js/ts/vue/images/wasm

```
Examples:
 pack ./somePath/index.ts
 pack ./somePath/index.ts --html
 pack ./somePath/index.ts -o ./dist/file.html
 pack ./somePath/index.ts -o ./dist/[name].[chunkhash].js
 pack ./somePath/index.ts -o ./dist/[name].[chunkhash].js --analyze


Usage: pack [options]

Options:
  -s, --source <src>         source file path
  -o, --output <output>      output file path (default: "./.temp/[name].[chunkhash].js")
  -w, --watch                watch (default: false)
  --polyfill                 use polyfill (default: false)
  --html [port]              preview in html without output. default port: 9999 (default: false)
  --analyze                  use webpack-bundle-analyzer (default: false)
  --target <target>          target (default: "web")
  --mode <mode>              mode (default: "development")
  --alias <alias>            resolve.alias (default: "")
  --extensions <extensions>  extensions with url-loader, --extensions .wav,.mp3  (default: ".wav,.mp3")
  --files <files>            extensions with file-loader, --files .node  (default: ".node")
  --raw <raw>                extensions with raw-loader, --raw .txt,.md  (default: ".txt,.md")
  --sourcemap <sourcemap>    sourcemap, default@development:cheap-module-eval-source-map; @production:'' (default:"auto")
  -h, --help                 output usage information
```

## asm(ts)/wasm

asm-loader: ts to wasm
wasm-loader: wasm buffer to promise

add.asm

```
export function add(a: i32, b: i32): i32 {
  return a + b;
}
```

entry.js

```
import mod from './add.asm';
//import mod from './add.wasm';
mod().then(({ exports: { add } }) => {
  console.log(add(3, 4));
});
```

or

```
import { get } from './fib.asm';

const fib = await get('fib');
fib?.(40);
```

---
_Source: https://npm.io/package/np-pack-cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
