open-index/open-npm huggingface dataset:
npm package: @jswork/loadenv
Description: Load dot env.
Latest version: 1.0.3

# loadenv
> Load dot env.

[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]

## installation
```shell
npm install @jswork/loadenv
```

## usage
```js
import loadenv from '@jswork/loadenv';

// usage goes here.
```

## types
```ts
/// <reference types="@jswork/loadenv/global.d.ts" />
```

## license
Code released under [the MIT license](https://github.com/afeiship/loadenv/blob/master/LICENSE.txt).

[version-image]: https://img.shields.io/npm/v/@jswork/loadenv
[version-url]: https://npmjs.org/package/@jswork/loadenv

[license-image]: https://img.shields.io/npm/l/@jswork/loadenv
[license-url]: https://github.com/afeiship/loadenv/blob/master/LICENSE.txt

[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/loadenv
[size-url]: https://github.com/afeiship/loadenv/blob/master/dist/index.min.js

[download-image]: https://img.shields.io/npm/dm/@jswork/loadenv
[download-url]: https://www.npmjs.com/package/@jswork/loadenv
npm package: @jswork/loading-screen
Description: Pure loading-screen for spa.
Author: afeiship
Latest version: 1.0.7

# loading-screen
> Pure loading-screen for spa.

[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]

## usage
```html
<!--1. add styles -->
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@jswork/loading-screen/dist/index.css"/>
<!-- OR -->
<link rel='stylesheet' type='text/css' href='https://unpkg.com/@jswork/loading-screen/dist/index.css' />

<!--2. add lskit -->
<script src="https://unpkg.com/@jswork/loading-screen/dist/lskit.js"></script>
<script>window.lskit()</script>

<!-- 3. optitional: configuration -->
<head>
  <style>
  .loading-screen{
    --ls-opts-top: 37.5%;
    --ls-opts-bar-color: #1890ff;
    --ls-opts-bar-width: 4px;
    --ls-opts-text-color: #999;
  }
  </style>
</head>
```

## lskit options
```json
{
  "id": "root",
  "lang": "language",
  "en-US": "Loading...",
  "zh-CN": "应用加载中...",
}
```

## preview
- https://afeiship.github.io/loading-screen/

## license
Code released under [the MIT license](https://github.com/afeiship/loading-screen/blob/master/LICENSE.txt).

[version-image]: https://img.shields.io/npm/v/@jswork/loading-screen
[version-url]: https://npmjs.org/package/@jswork/loading-screen

[license-image]: https://img.shields.io/npm/l/@jswork/loading-screen
[license-url]: https://github.com/afeiship/loading-screen/blob/master/LICENSE.txt

[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/loading-screen
[size-url]: https://github.com/afeiship/loading-screen/blob/master/dist/loading-screen.min.js

[download-image]: https://img.shields.io/npm/dm/@jswork/loading-screen
[download-url]: https://www.npmjs.com/package/@jswork/loading-screen
npm package: @jswork/loadkit
Description: Async load or preload scripts or styles.
Latest version: 1.0.6

# loadkit
> Async load or preload scripts or styles.

[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]

## installation
```shell
npm install @jswork/loadkit
```

## usage
```js
import loadkit from '@jswork/loadkit';

// usage goes here.
```

## license
Code released under [the MIT license](https://github.com/afeiship/loadkit/blob/master/LICENSE.txt).

[version-image]: https://img.shields.io/npm/v/@jswork/loadkit
[version-url]: https://npmjs.org/package/@jswork/loadkit

[license-image]: https://img.shields.io/npm/l/@jswork/loadkit
[license-url]: https://github.com/afeiship/loadkit/blob/master/LICENSE.txt

[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/loadkit
[size-url]: https://github.com/afeiship/loadkit/blob/master/dist/loadkit.min.js

[download-image]: https://img.shields.io/npm/dm/@jswork/loadkit
[download-url]: https://www.npmjs.com/package/@jswork/loadkit
npm package: @jswork/map-keys
Description: Recursively rename or copy object keys with full control.
Latest version: 1.0.2

# map-keys
> Recursively rename or copy object keys with full control.

[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]

## installation
```shell
yarn add @jswork/map-keys
```

## usage
```js
import mapKeys from '@jswork/map-keys';

// Basic key renaming
const data = { oldKey: 'value', keepKey: 'another' };
const result = mapKeys(data, { oldKey: 'newKey' });
// { newKey: 'value', keepKey: 'another' }

// Copy mode: keep both original and new keys
const result2 = mapKeys(data, { oldKey: 'newKey' }, { mode: 'copy' });
// { oldKey: 'value', keepKey: 'another', newKey: 'value' }

// Deep nested transformation
const nested = {
  users: [{ firstName: 'John', lastName: 'Doe' }]
};
const result3 = mapKeys(nested, {
  firstName: 'first_name',
  lastName: 'last_name'
});
// { users: [{ first_name: 'John', last_name: 'Doe' }] }
```

## license
Code released under [the MIT license](https://github.com/afeiship/map-keys/blob/master/LICENSE.txt).

[version-image]: https://img.shields.io/npm/v/@jswork/map-keys
[version-url]: https://npmjs.org/package/@jswork/map-keys

[license-image]: https://img.shields.io/npm/l/@jswork/map-keys
[license-url]: https://github.com/afeiship/map-keys/blob/master/LICENSE.txt

[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/map-keys
[size-url]: https://github.com/afeiship/map-keys/blob/master/dist/map-keys.min.js

[download-image]: https://img.shields.io/npm/dm/@jswork/map-keys
[download-url]: https://www.npmjs.com/package/@jswork/map-keys
npm package: @jswork/match-first
Description: Return the first value whose condition evaluates to true.
Latest version: 1.0.2

<p align="center">
  <img src="assets/logo.svg" width="1024" alt="match-first logo" />
</p>

<h1 align="center">match-first</h1>

<p align="center">Return the first value whose condition evaluates to true.</p>

[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]

## installation
```shell
yarn add @jswork/match-first
```

## usage
```ts
import matchFirst from '@jswork/match-first';

// Basic example: return first matching value
const result = matchFirst(
  [
    { condition: isHotfix, value: `hotfix ${id}` },
    { condition: taskType === 'bug', value: `bugfix ${id}` }
  ],
  `start ${id}`
);

// Conditional branching with fallback
const size = matchFirst(
  [
    { condition: x > 10, value: 'large' },
    { condition: x > 5, value: 'medium' }
  ],
  'small'
);

// Different value types
const config = matchFirst(
  [
    { condition: env === 'prod', value: { apiUrl: 'https://api.prod.com' } },
    { condition: env === 'staging', value: { apiUrl: 'https://api.staging.com' } }
  ],
  { apiUrl: 'http://localhost:3000' }
);
```

## license
Code released under [the MIT license](https://github.com/afeiship/match-first/blob/master/LICENSE.txt).

[version-image]: https://img.shields.io/npm/v/@jswork/match-first
[version-url]: https://npmjs.org/package/@jswork/match-first

[license-image]: https://img.shields.io/npm/l/@jswork/match-first
[license-url]: https://github.com/afeiship/match-first/blob/master/LICENSE.txt

[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/match-first
[size-url]: https://github.com/afeiship/match-first/blob/master/dist/match-first.min.js

[download-image]: https://img.shields.io/npm/dm/@jswork/match-first
[download-url]: https://www.npmjs.com/package/@jswork/match-first
npm package: @jswork/mathquill
Description: Make mathquill to umd package.
Author: afei
Latest version: 1.0.1

# mathquill
> Make mathquill to umd package.

[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]

## installation
```shell
npm install @jswork/mathquill
```

## resources
- https://github.com/mathquill/mathquill/issues/658

## license
Code released under [the MIT license](https://github.com/afeiship/mathquill/blob/master/LICENSE.txt).

[version-image]: https://img.shields.io/npm/v/@jswork/mathquill
[version-url]: https://npmjs.org/package/@jswork/mathquill

[license-image]: https://img.shields.io/npm/l/@jswork/mathquill
[license-url]: https://github.com/afeiship/mathquill/blob/master/LICENSE.txt

[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/mathquill
[size-url]: https://github.com/afeiship/mathquill/blob/master/dist/mathquill.min.js

[download-image]: https://img.shields.io/npm/dm/@jswork/mathquill
[download-url]: https://www.npmjs.com/package/@jswork/mathquill
npm package: @jswork/message-bridge
Description: Web/h5/mp bridge for web/mp.
Latest version: 1.0.19

# message-bridge
> Web/h5/mp bridge for web/mp.

[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]

## installation
```shell
yarn add @jswork/message-bridge
```

## usage
```js
import messageBridge from '@jswork/message-bridge';

// Register a handler for incoming messages
messageBridge.registerHandler('message:in', (data, responseCallback) => {
  console.log('Received data:', data);
  // Send response back
  responseCallback({ status: 'success' });
});

// Send a message and handle the response
messageBridge.callHandler('message:out', { type: 'request', payload: 'Hello!' }, (response) => {
  console.log('Got response:', response);
});
```

## license
Code released under [the MIT license](https://github.com/afeiship/message-bridge/blob/master/LICENSE.txt).

[version-image]: https://img.shields.io/npm/v/@jswork/message-bridge
[version-url]: https://npmjs.org/package/@jswork/message-bridge

[license-image]: https://img.shields.io/npm/l/@jswork/message-bridge
[license-url]: https://github.com/afeiship/message-bridge/blob/master/LICENSE.txt

[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/message-bridge
[size-url]: https://github.com/afeiship/message-bridge/blob/master/dist/message-bridge.min.js

[download-image]: https://img.shields.io/npm/dm/@jswork/message-bridge
[download-url]: https://www.npmjs.com/package/@jswork/message-bridge
npm package: @jswork/mina-deploy
Description: Miniprogram deploy.
Latest version: 1.0.9

# mina-deploy
> Miniprogram deploy.

[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]

## installation
```shell
yarn add @jswork/mina-deploy miniprogram-ci --dev
```

## usage
```js
const minaDeploy = require('@jswork/mina-deploy');
const pkg = require('./package.json');
const arguments = process.argv.splice(2);
const robot = parseInt(arguments[0]);

// 1: 正式版 2: 开发版
void minaDeploy({
  appid: 'wx_ID',
  projectPath: './dist/build/mp-weixin',
  robot,
  version: pkg.gtcVersion
});
```

## license
Code released under [the MIT license](https://github.com/afeiship/mina-deploy/blob/master/LICENSE.txt).

[version-image]: https://img.shields.io/npm/v/@jswork/mina-deploy
[version-url]: https://npmjs.org/package/@jswork/mina-deploy

[license-image]: https://img.shields.io/npm/l/@jswork/mina-deploy
[license-url]: https://github.com/afeiship/mina-deploy/blob/master/LICENSE.txt

[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/mina-deploy
[size-url]: https://github.com/afeiship/mina-deploy/blob/master/dist/mina-deploy.min.js

[download-image]: https://img.shields.io/npm/dm/@jswork/mina-deploy
[download-url]: https://www.npmjs.com/package/@jswork/mina-deploy
npm package: @jswork/minwait
Description: Ensure async operations take at least N milliseconds.
Latest version: 1.0.1

# minwait
> Ensure async operations take at least N milliseconds.

[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]

## installation
```shell
yarn add @jswork/minwait
```

## usage
```js
import minwait from '@jswork/minwait';

async function fetchData() {
  return new Promise(resolve => setTimeout(() => resolve('Data fetched!'), 50));
}

async function main() {
  console.log('Fetching data...');
  const result = await minwait(fetchData, 1000);
  console.log(result);
  // Expected output after at least 1000ms: Data fetched!
}

main();
```

## license
Code released under [the MIT license](https://github.com/afeiship/@jswork/minwait/blob/master/LICENSE.txt).

[version-image]: https://img.shields.io/npm/v/@jswork/minwait
[version-url]: https://npmjs.org/package/@jswork/minwait

[license-image]: https://img.shields.io/npm/l/@jswork/minwait
[license-url]: https://github.com/afeiship/@jswork/minwait/blob/master/LICENSE.txt

[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/minwait
[size-url]: https://github.com/afeiship/@jswork/minwait/blob/master/dist/@jswork/minwait.min.js

[download-image]: https://img.shields.io/npm/dm/@jswork/minwait
[download-url]: https://www.npmjs.com/package/@jswork/minwait
npm package: @jswork/mixin-decorator
Description: A decorator for mixins that doesn&#39;t overwrite existing methods.
Author: feizheng
Latest version: 1.0.0

# mixin-decorator
> A decorator for mixins that doesn't overwrite existing methods.

## installation
```shell
npm install @jswork/mixin-decorator
```

## usage
- npm install
```javascript
import mixin from '@jswork/mixin-decorator';

class A{
  static VERSION= '1.0';
  testA(){
    console.log('AAA')
  }
}


class B{
  static NAME ='BBB=NAME';
  testB(){
    console.log('BBB')
  }
}

@mixin(A,B)
class MyClass(){
  static VERSION = '2.0';
  sayHi(){
    console.log('hi');
  }
}

let my =new MyClass();

MyClass.VERSION; //2.0
MyClass.NAME; //BBB=NAME

my.testA(); //AAA
my.testB(); //BBB
```

## support str import for `webpack` project:
```js
//OLD:
module: {
    rules: [
      {
        test: /\.(js|jsx)$/,
        use: ['babel-loader'],
        exclude: /node_modules/,
      },
      //...
    ]
}

//NEW:
module: {
    rules: [
      {
        test: /\.(js|jsx)$/,
        use: ['babel-loader'],
        include: [
          resolve(__dirname, "../src"),
          resolve(__dirname, "../node_modules/mixin-decorator")
        ]
      },
      //...
    ]
}
```

## webpack resolve:(DO NOT USE .babelrc's resolve)
```js
import {resolve, join} from 'path';


resolve: {
  extensions: ['.js', '.json', '.scss', '.css'],
  alias:{
    mixins: resolve(__dirname, '../src/components/mixins')
  }
}
```

## todo list
- [x] add @mixin(['on-chnage',obj ]) for plain object
- [ ] NOT_SUPPORT add @mixin(['on-chnage',':node-module' ]) in npm
- [ ] add unit test

## resources
- https://github.com/webpack/webpack/issues/2031
- https://github.com/mbasso/react-decoration
- https://github.com/jayphelps/core-decorators
npm package: @jswork/mixin-react-on-change
Description: OnChange mixin for react.
Author: feizheng
Latest version: 1.0.1

# mixin-react-on-change
> OnChange mixin for react.

## installation
```bash
npm install -S @jswork/mixin-react-on-change
```

## bugs
- [ ] state when formData.xx_field

## usage
```js
// create file in: mixins/on-change.js
export default require('@jswork/mixin-react-on-change').default(nx.$app);


// <input onChange={this.onChangeToState.bind(this, 'user.nickname')}>
// <input onChange={this.onChangeToState.bind(this, 'user.phone')}>

// state:
{
  user:{
    nickname:'',
    phone:''
  }
}
```
npm package: @jswork/mkf
Description: Quick create config/dot file.
Author: afei
Latest version: 1.0.10

# mkf
> Quick create config/dot file.

[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]

![snapshot](https://p.ipic.vip/kqip22.png)

## installation
```shell
# public
npm i -g @jswork/mkf
```

## usage
~~~
Usage: mkf [options]

Options:
  -V, --version       output the version number
  -j, --jake          Create Jakefile.
  -m, --make          Create Makefile.
  -r, --rake          Create Rakefile.
  -g, --gulp          Create gulpfile.
  -n, --ncu           Create npm check update rc file.
  -e, --editorconfig  Create .editorconfig.
  -p, --prettier      Create prettier config file.
  -s, --schedule      Create whenever config/schedule.rb file.
  -l, --license       Create LICENSE file.
  --rit               Create .release-it config file.
  --gtc               Create .gtcrc config file.
  --verbose           Show verbose output.
  -h, --help          display help for command
~~~

## license
Code released under [the MIT license](https://github.com/afeiship/mkf/blob/master/LICENSE.txt).

[version-image]: https://img.shields.io/npm/v/@jswork/mkf
[version-url]: https://npmjs.org/package/@jswork/mkf

[license-image]: https://img.shields.io/npm/l/@jswork/mkf
[license-url]: https://github.com/afeiship/mkf/blob/master/LICENSE.txt

[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/mkf
[size-url]: https://github.com/afeiship/mkf/blob/master/dist/mkf.min.js

[download-image]: https://img.shields.io/npm/dm/@jswork/mkf
[download-url]: https://www.npmjs.com/package/@jswork/mkf
npm package: @jswork/mobxer-init
Description: Init tools for mobxer.
Latest version: 1.0.4

# mobxer-init
> Init tools for mobxer.

[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]

## installation
```shell
npm install @jswork/mobxer-init
```

## usage
```js
import mobxerInit from '@jswork/mobxer-init';

// usage goes here.
```

## license
Code released under [the MIT license](https://github.com/afeiship/mobxer-init/blob/master/LICENSE.txt).

[version-image]: https://img.shields.io/npm/v/@jswork/mobxer-init
[version-url]: https://npmjs.org/package/@jswork/mobxer-init

[license-image]: https://img.shields.io/npm/l/@jswork/mobxer-init
[license-url]: https://github.com/afeiship/mobxer-init/blob/master/LICENSE.txt

[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/mobxer-init
[size-url]: https://github.com/afeiship/mobxer-init/blob/master/dist/mobxer-init.min.js

[download-image]: https://img.shields.io/npm/dm/@jswork/mobxer-init
[download-url]: https://www.npmjs.com/package/@jswork/mobxer-init
npm package: @jswork/next
Description: A javascript OOP toolkit for mobile & modern web.
Author: afei
Latest version: 1.4.2

# next
> A javascript OOP toolkit for mobile & modern web.

[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]

## installation
```shell
npm install --save @jswork/next
```

## node
```js
import nx from '@jswork/next';

const MyClass = nx.declare({
  statics:{
    init: function(){
      console.log('hello next!')
    }
  }
})
```

## browser
```html
<script type="text/javascript" src="https://unpkg.com/@jswork/next"></script>
<script type="text/javascript">
(function (nx, global) {
  nx.declare('myApp', {
    statics: {
      init: function () {
        alert('hello next!');
      }
    }
  });
}(nx, nx.GLOBAL));
</script>
```

## license
Code released under [the MIT license](https://github.com/afeiship/next/blob/master/LICENSE.txt).

[version-image]: https://img.shields.io/npm/v/@jswork/next
[version-url]: https://npmjs.org/package/@jswork/next

[license-image]: https://img.shields.io/npm/l/@jswork/next
[license-url]: https://github.com/afeiship/next/blob/master/LICENSE.txt

[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next
[size-url]: https://github.com/afeiship/next/blob/master/dist/index.min.js

[download-image]: https://img.shields.io/npm/dm/@jswork/next
[download-url]: https://www.npmjs.com/package/@jswork/next
npm package: @jswork/next-absolute-package
Description: Get root path package.json.
Author: afei
Latest version: 1.0.1

# next-absolute-package
> Get root path package.json.

[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]

## installation
```bash
npm install -S @jswork/next-absolute-package
```

## usage
```js
import '@jswork/next-absolute-package';

nx.absolutePackage(); // { ...the whole package.json ... }
nx.absolutePackage('publishConfig.registry'); // https://registry.npmjs.org/
```

## license
Code released under [the MIT license](https://github.com/afeiship/next-absolute-package/blob/master/LICENSE.txt).

[version-image]: https://img.shields.io/npm/v/@jswork/next-absolute-package
[version-url]: https://npmjs.org/package/@jswork/next-absolute-package

[license-image]: https://img.shields.io/npm/l/@jswork/next-absolute-package
[license-url]: https://github.com/afeiship/next-absolute-package/blob/master/LICENSE.txt

[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-absolute-package
[size-url]: https://github.com/afeiship/next-absolute-package/blob/master/dist/next-absolute-package.min.js

[download-image]: https://img.shields.io/npm/dm/@jswork/next-absolute-package
[download-url]: https://www.npmjs.com/package/@jswork/next-absolute-package
npm package: @jswork/next-abstract-checkbox
Description: Abstract checkbox for next.
Author: afei
Latest version: 1.0.4

# next-abstract-checkbox
> Abstract checkbox for next.

[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]

<img src="./docs/Checkbox.png" width="100%"/>

## installation
```bash
npm install -S @jswork/next-abstract-checkbox
```

## apis
| api              | params | description                                  |
| ---------------- | ------ | -------------------------------------------- |
| checked          | -      | Property: Get the list checked status.       |
| indeterminate    | -      | Property: Get the list indeterminate status. |
| ids              | -      | Property: Get the all the list ids.          |
| select           | -      | Method: Select checkbox by id.               |
| selectMultiple   | -      | Method: Select checkbox by id list.          |
| selectAll        | -      | Method: Select all the checkbox.             |
| unSelect         | -      | Method: Deselct checkbox by id.              |
| unSelectMultiple | -      | Method: Deselct checkbox by id list.         |
| unSelectAll      | -      | Method: Deselct all the checkbox.            |
| get              | -      | Method: Get runtime ids list.                |

## usage
```js
import NxAbstractCheckbox from '@jswork/next-abstract-checkbox';

const checkboxer = new NxAbstractCheckbox({ 
  idKey: 'uuid', 
  items:[], 
  onChange: (e)=>{ 
    console.log(e.target.value);
  } 
});

const res = checkboxer.select(['4c4e97a96dc164db144452acdf993531']);

// ['4c4e97a96dc164db144452acdf993531']
```

## license
Code released under [the MIT license](https://github.com/afeiship/next-abstract-checkbox/blob/master/LICENSE.txt).

[version-image]: https://img.shields.io/npm/v/@jswork/next-abstract-checkbox
[version-url]: https://npmjs.org/package/@jswork/next-abstract-checkbox

[license-image]: https://img.shields.io/npm/l/@jswork/next-abstract-checkbox
[license-url]: https://github.com/afeiship/next-abstract-checkbox/blob/master/LICENSE.txt

[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-abstract-checkbox
[size-url]: https://github.com/afeiship/next-abstract-checkbox/blob/master/dist/next-abstract-checkbox.min.js

[download-image]: https://img.shields.io/npm/dm/@jswork/next-abstract-checkbox
[download-url]: https://www.npmjs.com/package/@jswork/next-abstract-checkbox
npm package: @jswork/next-abstract-configuration
Description: Abstract configuration.
Author: afei
Latest version: 1.0.5

# next-abstract-configuration
> Abstract configuration.

[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]

## installation
```bash
npm install -S @jswork/next-abstract-configuration
```

## apis
| api    | params       | description              |
| ------ | ------------ | ------------------------ |
| get    | path         | Get value from path      |
| gets   | -            | Get all values.          |
| set    | (path,value) | Set value by path.       |
| sets   | object       | Set multi value by path. |
| update | ojbect       | Set value and save.      |
| save   | -            | Save to path.            |


## usage
```js
import NxAbstractConfiguration from '@jswork/next-abstract-configuration';

// code goes here:
const conf = new NxAbstractConfiguration();
conf.set('name','@jswork/next-abstract-configuration');
conf.get('scirpts.build','gulp');
conf.sets({ name: 'fei', age: 100});
conf.gets();
```


## license
Code released under [the MIT license](https://github.com/afeiship/next-abstract-configuration/blob/master/LICENSE.txt).

[version-image]: https://img.shields.io/npm/v/@jswork/next-abstract-configuration
[version-url]: https://npmjs.org/package/@jswork/next-abstract-configuration

[license-image]: https://img.shields.io/npm/l/@jswork/next-abstract-configuration
[license-url]: https://github.com/afeiship/next-abstract-configuration/blob/master/LICENSE.txt

[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-abstract-configuration
[size-url]: https://github.com/afeiship/next-abstract-configuration/blob/master/dist/next-abstract-configuration.min.js

[download-image]: https://img.shields.io/npm/dm/@jswork/next-abstract-configuration
[download-url]: https://www.npmjs.com/package/@jswork/next-abstract-configuration
npm package: @jswork/next-abstract-expired-storage
Description: Abstract storage with expiration time.
Author: afei
Latest version: 1.0.0

# next-abstract-expired-storage
> Abstract storage with expiration time.

[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]

## installation
```bash
npm install -S @jswork/next-abstract-expired-storage
```

## apis
| api | params | description   |
|-----|--------|---------------|
| get | -      | desc balabala |

## usage
```js
import NxAbstractExpiredStorage from '@jswork/next-abstract-expired-storage';
import NxLocalStorage from '@jswork/next-local-storage';

const engine = new NxLocalStorage('abc');
// code goes here:
```

## license
Code released under [the MIT license](https://github.com/afeiship/next-abstract-expired-storage/blob/master/LICENSE.txt).

[version-image]: https://img.shields.io/npm/v/@jswork/next-abstract-expired-storage
[version-url]: https://npmjs.org/package/@jswork/next-abstract-expired-storage

[license-image]: https://img.shields.io/npm/l/@jswork/next-abstract-expired-storage
[license-url]: https://github.com/afeiship/next-abstract-expired-storage/blob/master/LICENSE.txt

[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-abstract-expired-storage
[size-url]: https://github.com/afeiship/next-abstract-expired-storage/blob/master/dist/next-abstract-expired-storage.min.js

[download-image]: https://img.shields.io/npm/dm/@jswork/next-abstract-expired-storage
[download-url]: https://www.npmjs.com/package/@jswork/next-abstract-expired-storage
npm package: @jswork/next-abstract-search-query
Description: Abstract search query for next.
Author: afei
Latest version: 1.0.4

# next-abstract-search-query
> Abstract search query for next.

[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]

## installation
```bash
npm install -S @jswork/next-abstract-search-query
```

## apis
| api  | params      | description               |
| ---- | ----------- | ------------------------- |
| get  | -           | Get qs like string.       |
| set  | (key,value) | Set key/value.            |
| sets | (obj)       | Set key/value use object. |

## usage
```js
import NxAbstractSearchQuery from '@jswork/next-abstract-search-query';

const initialState = {
  pageNo: 1,
  pageSize: 10,
  keyword: '',
  types: [],
  labels: []
};

const nxsq = new NxAbstractSearchQuery(initialState, {
  set: function(data,key,value){
    nx.set(data, key, value);
    if (!key.includes('page')) {
      data.pageNo = 1;
    }
  },
  onChange: function(inEvent){
    console.log(inEvent.target.value);
  }
});

// set/get

nxsq.set('pageNo', 2);
nxsq.get()
// 'pageNo=2&pageSize=10'

nxsq.set('labels', ['lb1', 'lb2']);
nxsq.get();
// 'pageNo=1&pageSize=10&labels=lb1,lb2'

// sets
nxsq.sets({ pageNo:2, pageSize:20 });

// get inner data
console.log(nxsq.data);

{
  pageNo: 2,
  pageSize: 10,
  keyword: '',
  types: [],
  labels: ['lb1', 'lb2']
}
```

## defaults
```js
const defaults = {
  url: null,
  onChange: nx.noop,
  onInit: nx.noop,
  set: function (data, key, value) {
    nx.set(data, key, value);
  },
  isEmpty: function (value) {
    return !value || value.length === 0;
  },
  transform: function (key, value) {
    var _value = Array.isArray(value) ? value.join() : value;
    return key + '=' + _value;
  }
};
```

## license
Code released under [the MIT license](https://github.com/afeiship/next-abstract-search-query/blob/master/LICENSE.txt).

[version-image]: https://img.shields.io/npm/v/@jswork/next-abstract-search-query
[version-url]: https://npmjs.org/package/@jswork/next-abstract-search-query

[license-image]: https://img.shields.io/npm/l/@jswork/next-abstract-search-query
[license-url]: https://github.com/afeiship/next-abstract-search-query/blob/master/LICENSE.txt

[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-abstract-search-query
[size-url]: https://github.com/afeiship/next-abstract-search-query/blob/master/dist/next-abstract-search-query.min.js

[download-image]: https://img.shields.io/npm/dm/@jswork/next-abstract-search-query
[download-url]: https://www.npmjs.com/package/@jswork/next-abstract-search-query
npm package: @jswork/next-active-state
Description: Mini state mananger based on proxy.
Author: afei
Latest version: 1.0.14

# next-active-state
> Mini state mananger based on proxy.

[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]

## installation
```bash
npm install -S @jswork/next-active-state
```

## apis
| api     | params | description                          |
| ------- | ------ | ------------------------------------ |
| get     | -      | Unwrap proxy data to pure js object. |
| on      | -      | Watch changed and return destroy fn. |
| one     | -      | Watch changed and return destroy fn. |
| reset   | -      | Watch changed and return destroy fn. |
| touched | -      | Get state has touched.               |
| #use    | -      | Use object with listener.            |
| #toJS   | -      | Transform to pure js object.         |

## usage
```js
import NxActiveState from '@jswork/next-active-state';

const data = { key: 1, value: 2 };
const instance = new NxActiveState(data);
const state = instance.state;

const res = instance.on('change', (arg) => {
  console.log(arg);
});

// create
state.newKey = 'I am new.';

// update
state.key = 122;

// delete
delete state.value;

// destroy resource
res.destroy();
```

```js
// simple use
const data = { key: 1, value: 2 };
const state = NxActiveState.use(data, (arg) => {
  console.log(arg);
});

// create
state.newKey = 'I am new.';

// update
state.key = 122;

// delete
delete state.value;

// no need to destroy resource
```


## license
Code released under [the MIT license](https://github.com/afeiship/next-active-state/blob/master/LICENSE.txt).

[version-image]: https://img.shields.io/npm/v/@jswork/next-active-state
[version-url]: https://npmjs.org/package/@jswork/next-active-state

[license-image]: https://img.shields.io/npm/l/@jswork/next-active-state
[license-url]: https://github.com/afeiship/next-active-state/blob/master/LICENSE.txt

[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-active-state
[size-url]: https://github.com/afeiship/next-active-state/blob/master/dist/next-active-state.min.js

[download-image]: https://img.shields.io/npm/dm/@jswork/next-active-state
[download-url]: https://www.npmjs.com/package/@jswork/next-active-state
npm package: @jswork/next-active-value
Description: Get active element value.
Author: afei
Latest version: 1.0.0

# next-active-value
> Get active element value.

[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]

## installation
```bash
npm install -S @jswork/next-active-value
```

## usage
```js
import '@jswork/next-active-value';

nx.activeValue({
  context: document,
})
```

## license
Code released under [the MIT license](https://github.com/afeiship/next-active-value/blob/master/LICENSE.txt).

[version-image]: https://img.shields.io/npm/v/@jswork/next-active-value
[version-url]: https://npmjs.org/package/@jswork/next-active-value

[license-image]: https://img.shields.io/npm/l/@jswork/next-active-value
[license-url]: https://github.com/afeiship/next-active-value/blob/master/LICENSE.txt

[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-active-value
[size-url]: https://github.com/afeiship/next-active-value/blob/master/dist/next-active-value.min.js

[download-image]: https://img.shields.io/npm/dm/@jswork/next-active-value
[download-url]: https://www.npmjs.com/package/@jswork/next-active-value
npm package: @jswork/next-activeable-data-list
Description: Next data list with active index.
Author: afei
Latest version: 1.0.0

# next-activeable-data-list
> Next data list with active index.

[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]

## installation
```bash
npm install -S @jswork/next-activeable-data-list
```

## apis
| api | params | description   |
|-----|--------|---------------|
| get | -      | Get current active item. |
| to | -      | Go to the input index. |
| next | -      | Go to next index. |
| prev | -      | Go to previous index. |
| first | -      | Go to first index. |
| last | -      | Go to last index. |

## options
```js
{ activeIndex: 0, continuous: false }
```

## usage
```js
import NxActiveableDataList from '@jswork/next-activeable-data-list';

const items = [
  "item1",
  "item2",
  "item3",
  "item4",
  "item5",
  "item6",
  "item7",
  "item8",
  "item9",
];

const list = new NxActiveableDataList();

list.next();    // 1
list.next();    // 2
list.prev();    // 1
list.prev();    // 0
```

## license
Code released under [the MIT license](https://github.com/afeiship/next-activeable-data-list/blob/master/LICENSE.txt).

[version-image]: https://img.shields.io/npm/v/@jswork/next-activeable-data-list
[version-url]: https://npmjs.org/package/@jswork/next-activeable-data-list

[license-image]: https://img.shields.io/npm/l/@jswork/next-activeable-data-list
[license-url]: https://github.com/afeiship/next-activeable-data-list/blob/master/LICENSE.txt

[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-activeable-data-list
[size-url]: https://github.com/afeiship/next-activeable-data-list/blob/master/dist/next-activeable-data-list.min.js

[download-image]: https://img.shields.io/npm/dm/@jswork/next-activeable-data-list
[download-url]: https://www.npmjs.com/package/@jswork/next-activeable-data-list
npm package: @jswork/next-admin-kits
Description: Next kits for admin sysytem.
Author: afei
Latest version: 1.0.59

# next-admin-kits
> Next kits for admin sysytem.

[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]

## installation
```bash
yarn add @jswork/next-admin-kits
```

## usage
```js
import '@jswork/next-admin-kits';

// init admin kits:
nx.AdminKits.create({ prefix: 'nak' });
```

## license
Code released under [the MIT license](https://github.com/afeiship/next-admin-kits/blob/master/LICENSE.txt).

[version-image]: https://img.shields.io/npm/v/@jswork/next-admin-kits
[version-url]: https://npmjs.org/package/@jswork/next-admin-kits

[license-image]: https://img.shields.io/npm/l/@jswork/next-admin-kits
[license-url]: https://github.com/afeiship/next-admin-kits/blob/master/LICENSE.txt

[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-admin-kits
[size-url]: https://github.com/afeiship/next-admin-kits/blob/master/dist/next-admin-kits.min.js

[download-image]: https://img.shields.io/npm/dm/@jswork/next-admin-kits
[download-url]: https://www.npmjs.com/package/@jswork/next-admin-kits
npm package: @jswork/next-alert
Description: Alert for debug detect platform.
Author: afei
Latest version: 1.0.0

# next-alert
> Alert for debug detect platform.

[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]

## installation
```bash
npm install -S @jswork/next-alert
```

## usage
```js
import '@jswork/next-alert';

nx.alert(1,2,3);
nx.alert({ github: 'afeiship', sayHi: 'hello' }, { slogan: 'Are you ok?' });
```

## license
Code released under [the MIT license](https://github.com/afeiship/next-alert/blob/master/LICENSE.txt).

[version-image]: https://img.shields.io/npm/v/@jswork/next-alert
[version-url]: https://npmjs.org/package/@jswork/next-alert

[license-image]: https://img.shields.io/npm/l/@jswork/next-alert
[license-url]: https://github.com/afeiship/next-alert/blob/master/LICENSE.txt

[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-alert
[size-url]: https://github.com/afeiship/next-alert/blob/master/dist/next-alert.min.js

[download-image]: https://img.shields.io/npm/dm/@jswork/next-alert
[download-url]: https://www.npmjs.com/package/@jswork/next-alert
npm package: @jswork/next-ant-column
Description: Ant table coumn for next.
Author: afei
Latest version: 1.1.4

# next-ant-column
> Ant table coumn for next.

[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]

## installation
```bash
npm install -S @jswork/next-ant-column
```

## usage
```js
import '@jswork/next-ant-column';

// use multiple args
get fields() {
  return [
    nx.antColumn('ID', 'id'),
    nx.antColumn('用户名', 'username'),
  ]
}

// or use an array
get fields() {
  return nx.antColumn([
    { title: 'ID', key: 'id' },
    { title: '昵称', key: 'nickname' },
    { title: '头像', key: 'avatar' }
  ]);
}
```

## license
Code released under [the MIT license](https://github.com/afeiship/next-ant-column/blob/master/LICENSE.txt).

[version-image]: https://img.shields.io/npm/v/@jswork/next-ant-column
[version-url]: https://npmjs.org/package/@jswork/next-ant-column

[license-image]: https://img.shields.io/npm/l/@jswork/next-ant-column
[license-url]: https://github.com/afeiship/next-ant-column/blob/master/LICENSE.txt

[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-ant-column
[size-url]: https://github.com/afeiship/next-ant-column/blob/master/dist/next-ant-column.min.js

[download-image]: https://img.shields.io/npm/dm/@jswork/next-ant-column
[download-url]: https://www.npmjs.com/package/@jswork/next-ant-column
npm package: @jswork/next-ant-fields
Description: Ant table column for next.
Author: afei
Latest version: 1.0.9

# next-ant-fields
> Ant table column for next.

[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]

## installation
```bash
yarn add @jswork/next-ant-fields
```

## usage
```js
import '@jswork/next-ant-fields';

// for string array
const fields1 = nx.antFields(['name', 'age', 'address']);
// fields1 will be like:
// [
//   { key: 'name', dataIndex: 'name', title: 'Name' },
//   { key: 'age', dataIndex: 'age', title: 'Age' },
//   { key: 'address', dataIndex: 'address', title: 'Address' }
// ]

// for object array
const fields2 = nx.antFields([
  { dataIndex: 'name', title: '姓名' },
  { dataIndex: 'age' },
  'address'
]);
// fields2 will be like:
// [
//   { dataIndex: 'name', title: '姓名', key: 'name' },
//   { dataIndex: 'age', title: 'Age', key: 'age' },
//   { dataIndex: 'address', title: 'Address', key: 'address' }
// ]

// with language option
// 1. setup language locales in config
nx.set(nx, 'cfg.next-ant-fields-schema', {
  language: 'zh-CN',
  defaults: {
    title: '标题',
    name: '姓名',
    age: '年龄'
  },
  locales: {
    'zh-CN': {
      title: '标题',
      name: '姓名',
      age: '年龄'
    },
    'en-US': {
      title: 'Title',
      name: 'Name',
      age: 'Age'
    }
  }
});

// 2. use default language from config (language)
const fields3 = nx.antFields(['title', 'name', 'age']);
// fields3 will be like:
// [
//   { key: 'title', dataIndex: 'title', title: '标题' },
//   { key: 'name', dataIndex: 'name', title: '姓名' },
//   { key: 'age', dataIndex: 'age', title: '年龄' }
// ]

// 3. specify language explicitly
const fields4 = nx.antFields(['title', 'name', 'age'], { language: 'en-US' });
// fields4 will be like:
// [
//   { key: 'title', dataIndex: 'title', title: 'Title' },
//   { key: 'name', dataIndex: 'name', title: 'Name' },
//   { key: 'age', dataIndex: 'age', title: 'Age' }
// ]
```

## license
Code released under [the MIT license](https://github.com/afeiship/next-ant-fields/blob/master/LICENSE.txt).

[version-image]: https://img.shields.io/npm/v/@jswork/next-ant-fields
[version-url]: https://npmjs.org/package/@jswork/next-ant-fields

[license-image]: https://img.shields.io/npm/l/@jswork/next-ant-fields
[license-url]: https://github.com/afeiship/next-ant-fields/blob/master/LICENSE.txt

[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-ant-fields
[size-url]: https://github.com/afeiship/next-ant-fields/blob/master/dist/next-ant-fields.min.js

[download-image]: https://img.shields.io/npm/dm/@jswork/next-ant-fields
[download-url]: https://www.npmjs.com/package/@jswork/next-ant-fields
npm package: @jswork/next-ant-fields-value
Description: Set fields value for ant design based on next.
Author: afei
Latest version: 1.0.0

# next-ant-fields-value
> Set fields value for ant design based on next.

[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]

## installation
```bash
npm install -S @jswork/next-ant-fields-value
```

## usage
```js
import '@jswork/next-ant-fields-value';

const obj = {
  username: 'afei',
  password: '1233',
  sex: 'male'
};

const result = nx.antFieldsValue( obj );

// result:
{
  username: { value: 'afei' },
  password: { value: '1233' },
  sex: { value: 'male' }
}
```

## license
Code released under [the MIT license](https://github.com/afeiship/next-ant-fields-value/blob/master/LICENSE.txt).

[version-image]: https://img.shields.io/npm/v/@jswork/next-ant-fields-value
[version-url]: https://npmjs.org/package/@jswork/next-ant-fields-value

[license-image]: https://img.shields.io/npm/l/@jswork/next-ant-fields-value
[license-url]: https://github.com/afeiship/next-ant-fields-value/blob/master/LICENSE.txt

[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-ant-fields-value
[size-url]: https://github.com/afeiship/next-ant-fields-value/blob/master/dist/next-ant-fields-value.min.js

[download-image]: https://img.shields.io/npm/dm/@jswork/next-ant-fields-value
[download-url]: https://www.npmjs.com/package/@jswork/next-ant-fields-value
npm package: @jswork/next-aop
Description: Aop for next.
Author: afei
Latest version: 1.0.0

# next-aop
> Aop for next.

[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]

## installation
```bash
npm install -S @jswork/next-aop
```

## usage
```js
import '@jswork/next-aop';

console.log = nx.aop(console.log, {
  before: function (oldConsole) {
    oldConsole('=--before--=');
  },
  after: function (oldConsole) {
    oldConsole('=--after--=');
  },
});

// test：
console.log('---abc---');

// =--before--=
// ---abc---
// =--after--=
```

## license
Code released under [the MIT license](https://github.com/afeiship/next-aop/blob/master/LICENSE.txt).

[version-image]: https://img.shields.io/npm/v/@jswork/next-aop
[version-url]: https://npmjs.org/package/@jswork/next-aop

[license-image]: https://img.shields.io/npm/l/@jswork/next-aop
[license-url]: https://github.com/afeiship/next-aop/blob/master/LICENSE.txt

[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-aop
[size-url]: https://github.com/afeiship/next-aop/blob/master/dist/next-aop.min.js

[download-image]: https://img.shields.io/npm/dm/@jswork/next-aop
[download-url]: https://www.npmjs.com/package/@jswork/next-aop
npm package: @jswork/next-apply
Description: Faster apply for next.
Author: afei
Latest version: 1.0.1

# next-apply
> Faster apply for next.

[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]

## installation
```bash
npm install -S @jswork/next-apply
```

## usage
```js
import '@jswork/next-apply';

function create2(tag, cls) {
  const el = document.createElement(tag);
  el.className = cls;
  el['data-cls'] = cls;
  el['data-tag'] = tag;
  return el;
}

nx.apply(create2, null, ['span','my-class1']);
```

## resources
- https://github.com/JayceTDE/fast-apply/blob/master/index.js
- https://www.cnblogs.com/lijiayi/p/callandapply.html
- https://blog.csdn.net/zhengyinhui100/article/details/7837127/

## license
Code released under [the MIT license](https://github.com/afeiship/next-apply/blob/master/LICENSE.txt).

[version-image]: https://img.shields.io/npm/v/@jswork/next-apply
[version-url]: https://npmjs.org/package/@jswork/next-apply

[license-image]: https://img.shields.io/npm/l/@jswork/next-apply
[license-url]: https://github.com/afeiship/next-apply/blob/master/LICENSE.txt

[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-apply
[size-url]: https://github.com/afeiship/next-apply/blob/master/dist/next-apply.min.js

[download-image]: https://img.shields.io/npm/dm/@jswork/next-apply
[download-url]: https://www.npmjs.com/package/@jswork/next-apply