# imod

> A bundler for tiny modules, powered by Rollup.

Latest version **1.5.0** (published 2019-12-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install imod
pnpm add imod
yarn add imod
bun add imod
```

Provides the commands `iMod`, `imod`, `imode`.

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.5.0 |
| Published | 2019-12-07 |
| First published | 2019-09-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >= 8 |
| Dependencies | 17 |
| Unpacked size | 156.3 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | haozime |
| Keywords | rollup, tiny module, typescript |

## Links

- npm: https://www.npmjs.com/package/imod
- Homepage: https://github.com/haozi/iMod
- Issues: https://github.com/haozi/iMod/issues
- npm.io page: https://npm.io/package/imod

## Dependencies (17)

- [ora](https://npm.io/package/ora.md) ^4.0.3
- [glob](https://npm.io/package/glob.md) ^7.1.6
- [tslib](https://npm.io/package/tslib.md) ^1.10.0
- [yargs](https://npm.io/package/yargs.md) ^15.0.2
- [colors](https://npm.io/package/colors.md) ^1.4.0
- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.1
- [rimraf](https://npm.io/package/rimraf.md) ^3.0.0
- [rollup](https://npm.io/package/rollup.md) ^1.27.8
- [jsonuri](https://npm.io/package/jsonuri.md) ^2.2.0
- [standard](https://npm.io/package/standard.md) ^14.3.1
- [camelcase](https://npm.io/package/camelcase.md) ^5.3.1
- [typescript](https://npm.io/package/typescript.md) ^3.7.3
- [@types/node](https://npm.io/package/@types/node.md) ^12.12.14
- [npm-updater](https://npm.io/package/npm-updater.md) ^3.0.3
- [@rollup/plugin-replace](https://npm.io/package/@rollup/plugin-replace.md) ^2.2.1
- [rollup-plugin-uglify-es](https://npm.io/package/rollup-plugin-uglify-es.md) ^0.0.1
- [rollup-plugin-typescript2](https://npm.io/package/rollup-plugin-typescript2.md) ^0.25.3

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.5.0 (latest) — 2019-12-07
- 1.4.2 — 2019-11-29
- 1.4.1 — 2019-11-29
- 1.4.0 — 2019-11-29
- 1.3.4 — 2019-11-19
- 1.3.3 — 2019-11-18
- 1.3.2 — 2019-11-18
- 1.3.1 — 2019-11-18
- 1.3.0 — 2019-11-14
- 1.2.5 — 2019-11-13
- 1.2.4 — 2019-11-13
- 1.2.3 — 2019-11-12
- 1.2.1 — 2019-11-12
- 1.2.0 — 2019-11-12
- 1.1.8 — 2019-10-14
- … 14 more at https://npm.io/package/imod/versions

## README

# iMod


---

## 1. Install

```bash
yarn global add imod
# or
sudo npm install imod -g
```

## 2. Showcase

### create a new project:
```bash
imod init ./hello
```

### with an existing project:

add these into [package.json](https://github.com/haozi/imod-template-module/blob/master/package.json#L7)

```json
{
  "main": "dist/index.js",
  "module": "dist/index.mjs",
  "types": "dist/types/index.d.ts",
  "scripts": {
    "build": "imod build",
    "dev": "imod dev"
  }
}
```

### with cli
```bash
imod dev
imod build
```

### with JavaScript
```typescript
import Imod from 'imod'
const iMod = new IMod({
  cwd: __dirname + '/../..'
})

iMod.build()
iMod.dev()
```

### create an example:

```bash
imod init ./hello --templateName=module --lite=true # If you don't use '--lite', it will try to install node_modules
```

## 3. Advanced configuration

* you can add a config at `package.json`, `./imod.config.js`, `./imod.config.json`, `./imodconfig.js`, `./imodconfig.json`
* The order in which imod looks up is `./imod.config.js` -> `./imod.config.json` -> `imodconfig.js` -> `imodconfig.json` -> `${package.json}.config.imod`


this is the default configuration:

```javascript
module.exports = {
  name: moduleName, // if not set, will guess from ${package.json}.name
  banner: '', // if not set, return ''
  input: '', // string | string[] | null. if not set, will find src/index*{.ts,.tsx,.js,.jsx,.es6,.es,.mjs}
  outDir: '', // string. default is './dist'
  declarationDir: false,  // string | false. if false will no typings
  compilerOptions: [
    {
      format: 'esm',
      extName: '.mjs',
      target: 'esnext'
    },
    {
      format: 'cjs',
      extName: '.js',
      target: 'es5'
    },
    {
      format: 'umd',
      extName: '.min.js',
      target: 'es5'
    }
  ]
}
```

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