open-index/open-npm huggingface dataset:
npm package: @gzz-test/version-webpack-plugin
Description: append version in html
Author: guangzezhu
Latest version: 0.0.6

## html 追加版本号

### options
| 参数 | 说明 | 类型 | 默认值 |
| ---- | ---- | ---- | ---- |
| path             | html 路径 | string | dist/index.html |
| version          | 版本号 | string | version in pakcage.json |
| suffix           | version 后缀 | ISuffixOptions | { datetimeHuman: true, timestamp: true } |
| callback         | custom full VersinName | Function | |

### require
**[version-webpack-plugin] require Node.js 16 or newer**

### install
```
npm i @drumup/version-webpack-plugin -D
```

### demo
```
const VersionWebpackPlugin = require("@drumup/version-webpack-plugin")

new VersionWebpackPlugin({
  path: 'dist/index.html'
  version: "",
  suffix: {
    date: false,
    time: false,
    timestamp: true,
  },
  callback: () => {
    return 'custome_version_info_by_callback'
  }
})
```
### dist/index.html
```
<!DOCTYPE html><html><head><meta name="version" content="custome_version_info_by_callback"><title>@gzz-kit/version-webpack-plugin</title>...
```
npm package: @gzzhanghao/babel-require
Description: Require modules with standalone babel context.
Author: Jason
Latest version: 0.1.2-legacy

# babel-require

Require modules with standalone babel context.

## Usage

```javascript
import BabelRequire from 'babel-require'

const babelRequire = new BabelRequire({
  globals: {
    // global variables in child context
  },
  // you can use your own babel-polyfill and babel-register module
  polyfillPath: 'babel-polyfill/dist/polyfill',
  registerPath: 'babel-register',
  babelOptions: {
    // options available in babel-register
  },
})


// you can access the global object of child context with:
babelRequire.context

const module = babelRequire.require(modulePath)
```
npm package: @gzzhanghao/docx
Description: A dead simple docx parser.
Author: Jason
Latest version: 0.2.0

# docx

A dead simple docx parser.

## Usage

```javascript
import parseDocx from '@gzzhanghao/docx'

parseDocx(buffer).then(async docx => {

  // access jszip object
  docx.zip

  // read file in docx
  // type: string | text | binarystring | base64 | array | uint8array | arraybuffer | nodebuffer
  await docx.readFile(path, type)

  // parse xml file in docx
  await docx.parseFile(path)

  // access to files in docx
  docx.relations // word/_rels/document.xml.rels
  docx.document  // word/document.xml
  docx.numbering // word/numbering.xml
  docx.comments  // word/comments.xml
  docx.styles    // word/styles.xml
})
```
npm package: @gzzhanghao/docx2quill
Description: Convert DOCX to Quill Delta.
Author: Jason
Latest version: 0.3.1

# docx2quill

Convert DocX to Quill Delta.

__This package is under heavy development, use it at your own risk__

## Usage

```javascript
import docx2Quill from '@gzzhanghao/docx2quill'

docx2Quill(docxBuffer, {

  /**
   * Custom image processor
   */
  async processImage(parser, filePath, size) {
    parser.delta = parser.delta.insert({
      image: await uploadImage(await parser.zip.file(filePath).async('nodebuffer'))
    }, {
      width: size.width,
      height: size.height,
    })
  },

  /**
   * Report for item not found error
   */
  notfoundError(type, id) {
    // type: number | abstract number | level | relationship | style
  },

}).then(delta => {

  // delta: Quill Delta
})
```
npm package: @gzzhanghao/exec
Description: Execute commands in node
Author: Jason
Latest version: 0.1.0

# X

Execute commands in node.js

## Installation

```bash
npm i -S @gzzhanghao/x
```

## Usage

```javascript
import x from '@gzzhanghao/x'

export async function build(opts) {
  await x(`
    run-any-cmd --with-args ${x.e.SOME_ENV_VARIABLE}
    like makefile
  `)
}
```
npm package: @gzzhanghao/mk
Description: Make in node
Author: Jason
Latest version: 0.1.3

# Mk

Make in node.js

## Installation

```bash
npm i -g @gzzhanghao/mk
```

## Usage

Write a Makefile.js:

```javascript
// Makefile.js

exports.build = function(args) {
  return new Promise((resolve, reject) => {
    // do some stuff
  })
}
```

Then run it with mk:

```bash
mk build
```

You can specify babel options with babelrc:

```javascript
{
  plugins: [
    'transform-async-to-generator',
    'transform-es2015-modules-commonjs',
  ],
}
```

Then you can write your Makefile with babel:

```javascript
export async function build(args) {
  // do some stuff...
}
```

## Use with x

Mk works great with [x module](https://github.com/gzzhanghao/x)

```javascript
import x from '@gzzhanghao/x'

export async function build(args) {
  await x(`
    rm -rf tmp dest && mkdir dest
    babel src -d tmp
    browserify tmp/index.js -o dest/bundle.js
  `)
  await x([
    'rm -rf tmp',
    'uglifyjs --compress --mangle -- dest/index.js > dest/bundle.min.js',
  ])
}
```
npm package: @gzzhanghao/mocker-utils
Description: A set of util functions for mocker
Author: Jason
Latest version: 3.0.0

# @gzzhanghao/mocker-utils

Utility functions for building mocker's mockup rules.

## Usage

```bash
npm i -S @gzzhagnaho/mocker-utils
```

Then import the package in your mocker rules:

```javascript
//
// Import functions from mocker-utils:
//
// import { file } from '@gzzhangaho/mocker-utils'
//
export default [

  '//www.google.com/', [

    // response `www.google.com` with `/tmp/google.html`
    // request will pass through if the file does not exists
    file('/tmp/google.html'),

    // send request and save the response body into `/tmp/google.html`
    save('/tmp/google.html'),
  ],

  // respond with html content
  '//mocker.io/', [
    req => html(`<h1>It works ${req.query.name}!</h1>`),
  ],

  // respond with json data
  '//mocker.io/awesome-api', [
    req => json({ username: req.query.name }),
  ],

  // add CORS / custom headers to third-party API
  '//awesome.com/api', [
    headers({ 'access-control-expose-headers': 'X-My-Custom-Header' }),
    cors(),
  ],

  // Hijacking WebSocket connection. http://www.websocket.org/echo.html
  'ws://echo.websocket.org', async req => {
    const socket = await ws(req)
    socket.on('message', msg => {
      socket.send(`[MOCKER] ${msg}`)
    })
  },
]
```
npm package: @gzzhanghao/quill-docx
Description: Convert DOCX to Quill Delta.
Author: Jason
Latest version: 0.1.10
Deprecated: WARNING: This project has been renamed to @gzzhanghao/docx2quill, install using @gzzhanghao/docx2quill instead.

# quill-docx

Convert DOCX to Quill Delta.

__This package is under heavy development, use it at your own risk__

## Usage

```javascript
import QuillDocx from '@gzzhanghao/quill-docx'

QuillDocx(docxBuffer).then(delta => {
  // :tada:
})
```
npm package: @gzzhanghao/quill2docx
Description: Convert Quill Delta to DocX.
Author: Jason
Latest version: 0.1.6

# quill2docx

Convert Quill Delta to DocX.

__This package is under heavy development, use it at your own risk__

## Usage

```javascript
import quill2Docx from '@gzzhanghao/quill2docx'

quill2Docx(delta, {

  /**
   * Handle non-string content
   */
  handleCustomOperation(p, op) {

    // p: pObj in officegen
    // op: quill delta's operation

    // handle images, divider, etc...

    p.addText('[NOT_SUPPORTED_CONTENT]')
  },

}).then(docx => {

  // docx: officegen object

  docx.generate(outputStream)
})
```
npm package: @gzzhanghao/worker-farm
Description: A worker farm that works
Author: Jason
Latest version: 0.1.0

# WorkerFarm

Yet another worker-farm. Check out [node-worker-farm](https://github.com/rvagg/node-worker-farm) for production usage.

__WARNING: This package is under heavy development and should be considered unstable, use it at your own risk__

## Usage

Install the worker farm with:

```bash
npm i -S @gzzhanghao/worker-farm
```

Then you should be able to import the worker farm:

```javascript
const createFarm = require('@gzzhanghao/worker-farm').default
```

## API

### `createFarm(modulePath: string, opts: Object): WorkerFarm`

Create a worker farm with `modulePath` and `options`. The `modulePath` should be an absolute path to the the module that runs in workers.

Available options are:

```javascript
{
  maxConcurrentWorkers : require('os').cpus().length,
  maxConcurrentCalls   : Infinity,
  maxCallTime          : Infinity,
  maxRetries           : Infinity,
  autoStart            : true,
}
```

Check out `node-worker-farm`'s [documentation](https://github.com/rvagg/node-worker-farm#options) for more details.

### `workerFarm.fillUp(): void`

Fill up the worker farm with workers. It will keep adding workers to the worker farm until there are `options.maxConcurrentWorkers` workers in the farm.

### `workerFarm.addWorker(): void`

Add a worker to the worker farm. Throws if there are already `options.maxConcurrentWorkers` workers in the farm.

### `workerFarm.layoff(): void`

Dismiss an idle worker, or dismiss the next worker that finished its task if all workers are busy at the moment.

### `workerFarm.run(args = [], method = null): Promise&lt;any&gt;`

Run a task with the worker farm. The worker farm will invoke the `method` function exported by the module specified by the `modulePath`. If `method` is not specified, it will invoke the method exported by `module.exports` instead.

### `close(): void`

Close the farm once it finished all pending tasks.

### `destroy(): void`

Destroy the worker farm immediately. This method will reject all unfinished tasks.

## Example

```javascript
'use strict'

const babel = require('babel-core')

module.exports = (content, opts) => {
  try {
    // or return a Promise for async tasks
    return babel.transform(content, opts).code
  } catch (error) {
    // values should be able JSON-serializable
    throw { message: error.message, stack: error.stack }
  }
}
```
npm package: @gzzhanghao/x
Description: Execute commands in node
Author: Jason
Latest version: 1.1.5

# X

Execute commands in node.js

## Installation

```bash
npm i -S @gzzhanghao/x
```

## Usage

```javascript
import { x } from '@gzzhanghao/x'

export async function build(opts) {
  await x(`
    run-any-cmd --with-args ${x.e.SOME_ENV_VARIABLE}
    like makefile
  `)
}
```

### e

Identical to process.env.

### x(commands[, options])

Execute series of commands. Pass an array to run commands in parallel.

```javascript
await x(['rm -rf dist', 'mkdir tmp'])
```

### g(command[, options])

Get output from a command.

```javascript
await g('ls -alh') // -> { code, signal, stdout, stdin, encoding }
'' + await g('ls') // -> ls's stdout
```