open-index/open-npm huggingface dataset:
npm package: @jsenv/sample-project
Description: [![npm package](https://img.shields.io/npm/v/@jsenv/sample-project.svg)](https://www.npmjs.com/package/@jsenv/sample-project) [![build](https://travis-ci.com/jsenv/jsenv-sample-project.svg?branch=master)](http://travis-ci.com/jsenv/jsenv-sample-project) [
Latest version: 3.0.0

# jsenv-sample-project

[![npm package](https://img.shields.io/npm/v/@jsenv/sample-project.svg)](https://www.npmjs.com/package/@jsenv/sample-project)
[![build](https://travis-ci.com/jsenv/jsenv-sample-project.svg?branch=master)](http://travis-ci.com/jsenv/jsenv-sample-project)
[![codecov](https://codecov.io/gh/jsenv/jsenv-sample-project/branch/master/graph/badge.svg)](https://codecov.io/gh/jsenv/jsenv-sample-project)

> Example of a project using jsenv.
npm package: @jsenv/sample-project-client
Description: [![npm package](https://img.shields.io/npm/v/@jsenv/sample-project-client.svg)](https://www.npmjs.com/package/@jsenv/sample-project-client) [![build](https://travis-ci.com/jsenv/jsenv-sample-project-client.svg?branch=master)](http://travis-ci.com/jsenv/js
Latest version: 4.0.0

# jsenv-sample-project-client

[![npm package](https://img.shields.io/npm/v/@jsenv/sample-project-client.svg)](https://www.npmjs.com/package/@jsenv/sample-project-client)
[![build](https://travis-ci.com/jsenv/jsenv-sample-project-client.svg?branch=master)](http://travis-ci.com/jsenv/jsenv-sample-project-client)
[![codecov](https://codecov.io/gh/jsenv/jsenv-sample-project-client/branch/master/graph/badge.svg)](https://codecov.io/gh/jsenv/jsenv-sample-project-client)
npm package: @jsenv/sass
Description: Enable sass in jsenv.
Latest version: 2.0.0

# jsenv-sass

Enable scss and sass files in jsenv.

[![npm package](https://img.shields.io/npm/v/@jsenv/sass.svg?logo=npm&label=package)](https://www.npmjs.com/package/@jsenv/sass)

# Usage

<details>
  <summary>1 - Install <code>@jsenv/sass</code></summary>

```console
npm install --save-dev @jsenv/sass
```

</details>

<details>
  <summary>2 - Use <code>jsenvCompilerForSass</code></summary>

Add a `customCompilers` export into `jsenv.config.js`:

```js
import { jsenvCompilerForSass } from "@jsenv/sass"

export const customCompilers = { ...jsenvCompilerForSass }
```

</details>
npm package: @jsenv/segmentation
Description: [![npm package](https://img.shields.io/npm/v/@jsenv/segmentation.svg)](https://www.npmjs.com/package/@jsenv/segmentation) [![build](https://travis-ci.com/jsenv/jsenv-segmentation.svg?branch=master)](http://travis-ci.com/jsenv/jsenv-segmentation) [![codeco
Latest version: 1.0.0

# jsenv segmentation

[![npm package](https://img.shields.io/npm/v/@jsenv/segmentation.svg)](https://www.npmjs.com/package/@jsenv/segmentation)
[![build](https://travis-ci.com/jsenv/jsenv-segmentation.svg?branch=master)](http://travis-ci.com/jsenv/jsenv-segmentation)
[![codecov](https://codecov.io/gh/jsenv/jsenv-segmentation/branch/master/graph/badge.svg)](https://codecov.io/gh/jsenv/jsenv-segmentation)
npm package: @jsenv/template-node-package
Description: Package description
Author: dmail
Latest version: 1.1.3

> The documentation below is part of the [GitHub repository template](https://docs.github.com/en/github-ae@latest/github/creating-cloning-and-archiving-repositories/creating-a-repository-from-a-template#creating-a-repository-from-a-template). Check [.github/README.md](./.github/README.md) to read documentation about the template itself.

# Node package title [![npm package](https://img.shields.io/npm/v/@jsenv/template-node-package.svg?logo=npm&label=package)](https://www.npmjs.com/package/@jsenv/template-node-package) [![github main](https://github.com/jsenv/jsenv-template-node-package/workflows/main/badge.svg)](https://github.com/jsenv/jsenv-template-node-package/actions?workflow=main) [![codecov coverage](https://codecov.io/gh/jsenv/jsenv-template-node-package/branch/main/graph/badge.svg)](https://codecov.io/gh/jsenv/jsenv-template-node-package)

This package is a demo for https://github.com/jsenv/jsenv-template-node-package. It is not meant to provide anything useful.

# Installation

```console
npm install @jsenv/template-node-package
```

## 1. Create <code>example.js</code>

```js
import { getMessage } from "@jsenv/template-node-package"

console.log(getMessage())
```

## 2. Execute with node

```console
> node ./example.js
Hello dev!
```

# getMessage

_getMessage_ is a function returning a string.

```js
import { getMessage } from "@jsenv/template-node-package"

const message = getMessage()
message // "Hello dev!"
```

The returned string is different in [production mode](#production-mode)

# getMessageAsync

_getMessageAsync_ is like [getMessage](#getMessage) except it's an async function.

```js
import { getMessageAsync } from "@jsenv/template-node-package"

const message = await getMessageAsync()
message // "Hello dev!"
```

# Development

If you are part or want to be part of the developpers of this package, check [development.md](./docs/development.md)
npm package: @jsenv/test
Description: Executing test files in web browsers or Node.js.   This tool enforce test files to be written as **standard** files, without any sort of complexity.
Latest version: 3.7.19

# @jsenv/test [![npm package](https://img.shields.io/npm/v/@jsenv/test.svg?logo=npm&label=package)](https://www.npmjs.com/package/@jsenv/test)

Executing test files in web browsers or Node.js.  
This tool enforce test files to be written as **standard** files, without any sort of complexity.

- [Documentation](<https://github.com/jsenv/core/wiki/D)-Test>)
- [Comparison with Jest](./docs/comparison_jest.md)
npm package: @jsenv/testing
Description: [![github package](https://img.shields.io/github/package-json/v/jsenv/jsenv-testing.svg?label=package&logo=github)](https://github.com/jsenv/jsenv-testing/packages) [![ci status](https://github.com/jsenv/jsenv-testing/workflows/ci/badge.svg)](https://gith
Latest version: 3.6.0

# jsenv testing

[![github package](https://img.shields.io/github/package-json/v/jsenv/jsenv-testing.svg?label=package&logo=github)](https://github.com/jsenv/jsenv-testing/packages)
[![ci status](https://github.com/jsenv/jsenv-testing/workflows/ci/badge.svg)](https://github.com/jsenv/jsenv-testing/actions)
[![codecov](https://codecov.io/gh/jsenv/jsenv-testing/branch/master/graph/badge.svg)](https://codecov.io/gh/jsenv/jsenv-testing)

## Introduction

`@jsenv/testing` is used by jsenv projects to execute tests and generate coverage.<br />

It has the following exports

- `test`
- `cover`
- `startContinuousTesting`

## How to use

To understand how to use jsenv testing let's use it on a "real" project.<br /> We will setup a basic project and execute tests, then see how to get test coverage.

### Basic project setup

1. Create basic project file structure

   — see [./docs/basic-project](./docs/basic-project)

2. Install dev dependencies

   ```console
   npm install
   ```

### `test` example

```console
node ./execute-tests.js
```

I made a video recording terminal during execution `basic-project/execute-tests.js`. The gif below was generated from that video.

![test terminal recording](./docs/test-terminal-recording.gif)

Cool isn't it?

If you want to know more about `test`, there is a dedicated page for that.<br />
— see [`test` documentation](./docs/test-doc.md)

From this point you can generate coverage for that basic project.<br />
If you are interested by this, it is explained in the next part.

### `cover` example

```console
node ./generate-coverage.js
```

It will execute tests and generate `basic-project/coverage/coverage-final.json`.

I made a gif to illustrate one thing you can get after generating basic project coverage. You can see me exploring the files to see coverage of `basic-project/src/platform-name.js`.<br />

![browsing coverage recording](./docs/coverage-browsing-recording.gif)

These files will be generated only if you pass `coverageHtmlReport: true` to `cover`.

#### What is `coverage-final.json` ?

At this point you have a `basic-project/coverage/coverage-final.json` file. You can pass it to a code coverage tool and get valuable information from it.<br />

It's important to know that `coverage-final.json` format comes from `instanbul`.<br />
— see [istanbul on github](https://github.com/gotwarlost/istanbul)

The most valuable thing to do with that file is to feed it to some code coverage tool during your continuous integration script.
I have documented one of them named `codecov.io` but you can integrate with pretty much anything else.<br />
— see [uploading coverage to codecov.io](./docs/uploading-coverage-to-codecov.md)

### `startContinuousTesting` example

To be documented, in any case it's an experimental for now.
npm package: @jsenv/uneval
Description: Convert value into evaluable string.
Latest version: 1.6.0

# uneval

Convert value into evaluable string.

[![github package](https://img.shields.io/github/package-json/v/jsenv/jsenv-uneval.svg?logo=github&label=package)](https://github.com/jsenv/jsenv-uneval/packages)
[![npm package](https://img.shields.io/npm/v/@jsenv/uneval.svg?logo=npm&label=package)](https://www.npmjs.com/package/@jsenv/uneval)
[![github ci](https://github.com/jsenv/jsenv-uneval/workflows/ci/badge.svg)](https://github.com/jsenv/jsenv-uneval/actions?workflow=ci)
[![codecov coverage](https://codecov.io/gh/jsenv/jsenv-uneval/branch/master/graph/badge.svg)](https://codecov.io/gh/jsenv/jsenv-uneval)

# Table of contents

- [Presentation](#Presentation)
- [JSON.stringify limits](#JSONstringify-limits)
- [Browser example](#Browser-example)
- [Node example](#Node-example)
- [Installation](#Installation)

# Presentation

`@jsenv/uneval` turns a JavaScript value into a string that can be evaluated. It exists to overcome `JSON.stringify` limitations.

Using `@jsenv/uneval` + `eval` is more powerful and accurate than `JSON.stringify` + `JSON.parse`. It supports circular structure and preserves types like `Date`, `Infinity`, `-0`, `BigInt` and more.

However `JSON.stringify` is way faster and is safe (it cannot execute arbitrary code). So **prefer `JSON.stringify + JSON.parse` over `uneval + eval` when you can**.

## JSON.stringify limits

- Returns `"{}"` for a regexp

  ```js
  JSON.stringify(/foo/) === "{}"
  ```

- Returns `"0"` for `-0`

  ```js
  JSON.stringify(-0) === "0"
  ```

- Returns `"null"` for `NaN`

  ```js
  JSON.stringify(NaN) === "null"
  ```

- Returns `"null"` for `Infinity`

  ```js
  JSON.stringify(Infinity) === "null"
  ```

- Returns a string for a date

  ```js
  JSON.stringify(new Date(0)) === `"1970-01-01T00:00:00.000Z"`
  ```

- Throws on BigInt

  ```js
  try {
    JSON.stringify(1n)
  } catch (e) {
    e.type // "TypeError"
    e.message // "Do not know how to serialize a BigInt"
  }
  ```

- Throws on circular structure

  ```js
  const value = {}
  value.self = value
  try {
    JSON.stringify(value)
  } catch (error) {
    error.name // "TypeError"
    error.message // "Converting circular structure to JSON"
  }
  ```

- Ignores non enumerable properties

  ```js
  JSON.stringify(Object.defineProperty({}, "foo", { enumerable: false })) === "{}"
  ```

- Is not optimized for repetitive structure

  ```js
  const value = "a-very-long-string"
  JSON.stringify([value, value])
  ```

  `"a-very-long-string"` would be repeated twice the string.

## Browser example

```html
<script src="https://unpkg.com/@jsenv/uneval@1.1.0/dist/global/main.js"></script>
<script>
  const { uneval } = window.__jsenv_uneval__
  console.log(eval(uneval({ answer: 42 })))
</script>
```

— see also https://jsenv.github.io/jsenv-uneval/browser-example.

## Node example

```js
const { uneval } = require("@jsenv/uneval")

console.log(eval(uneval({ answer: 42 })))
```

— see also https://jsenv.github.io/jsenv-uneval/node-example.

# Installation

```console
npm install @jsenv/uneval
```
npm package: @jsenv/url-meta
Description: Associate value to urls using pattern matching.
Author: dmail
Latest version: 8.5.7

# url meta

Associate value to urls using pattern matching.

```js
import { URL_META } from "@jsenv/url-meta";

// conditionally associates url and values
const associations = {
  color: {
    "file:///*": "black",
    "file:///*.js": "red",
  },
};
const getUrlColor = (url) => {
  const { color } = URL_META.applyAssociations({ url, associations });
  return color;
};
console.log(`file.json color is ${getUrlColor("file:///file.json")}`);
console.log(`file.js color is ${getUrlColor("file:///file.js")}`);
```

_Code above logs_

```console
file.json color is black
file.js color is red
```

# Common pattern example

| pattern            | Description                          |
| ------------------ | ------------------------------------ |
| `**/`              | Everything                           |
| `*/**/`            | Inside a directory                   |
| `**/.*/`           | Inside directory starting with a dot |
| `**/node_modules/` | Inside any `node_modules` directory  |
| `node_modules/`    | Inside root `node_modules` directory |
| `**/*.map`         | Ending with `.map`                   |
| `**/*.test.*`      | Contains `.test.`                    |
| `*`                | Inside the root directory only       |
| `*/*`              | Inside a directory of depth 1        |

Read more at [./pattern_matching.md](./pattern_matching.md)

# associations

_associations_ below translates into: "files are visible except thoose in .git/ directory"

```js
const associations = {
  visible: {
    "**/*/": true,
    "**/.git/": false,
  },
};
```

_associations_ allows to group patterns per property which are easy to read and compose.
All keys in _associations_ must be absolute urls, this can be done with [resolveAssociations](#resolveAssociations).

# resolveAssociations

_resolveAssociations_ is a function resolving _associations_ keys that may contain relative urls against an _url_.

```js
import { URL_META } from "@jsenv/url-meta";

const associations = URL_META.resolveAssociations(
  {
    visible: {
      "**/*/": true,
      "**/.git/": false,
    },
  },
  "file:///Users/directory/",
);
console.log(JSON.stringify(associations, null, "  "));
```

```json
{
  "visible": {
    "file:///Users/directory/**/*/": true,
    "file:///Users/directory/**/.git/": false
  }
}
```
npm package: @jsenv/vue
Description: Enable vue in jsenv.
Latest version: 1.0.0-alpha

# jsenv-vue

Enable vue files in jsenv.

[![npm package](https://img.shields.io/npm/v/@jsenv/vue.svg?logo=npm&label=package)](https://www.npmjs.com/package/@jsenv/vue)

**WARNING:** My experience with Vue.js is non existent. Consequently I have no idea how it would integrate with a codebase written in Vue.js. I made this package as a proof of concept to ensure jsenv is capable to run `.vue` files.

# Usage

<details>
  <summary>1 - Install <code>@jsenv/vue</code></summary>

```console
npm install --save-dev @jsenv/vue
```

</details>

<details>
  <summary>2 - Use <code>jsenvCompilerForVue</code></summary>

Add a `customCompilers` export into `jsenv.config.js`:

```js
import { jsenvCompilerForVue } from "@jsenv/vue"

export const customCompilers = [jsenvCompilerForVue]
```

</details>
npm package: @jsenv/workers
Description: Split CPU intensive code into worker threads
Author: dmail
Latest version: 1.2.0

# jsenv workers [![npm package](https://img.shields.io/npm/v/@jsenv/workers.svg?logo=npm&label=package)](https://www.npmjs.com/package/@jsenv/workers) [![github main](https://github.com/jsenv/workers/workflows/main/badge.svg)](https://github.com/jsenv/workers/actions?workflow=main) [![codecov coverage](https://codecov.io/gh/jsenv/workers/branch/main/graph/badge.svg)](https://codecov.io/gh/jsenv/workers)

Split CPU intensive code into worker threads.

## Example

_worker.mjs:_

```js
import { parentPort } from "node:worker_threads"

parentPort.on("message", async ({ a, b }) => {
  await new Promise((resolve) => setTimeout(resolve, 100))
  const returnValue = a + b
  parentPort.postMessage(returnValue)
})
```

_main.mjs:_

```js
import { createWorkers } from "@jsenv/workers"

const workers = createWorkers(new URL("./worker.mjs", import.meta.url))

const value = await workers.addJob({ a: 1, b: 1 })
console.log(value) // 2
```

## Static pool

By default the pool size is dynamic but it can be fixed to X workers.

```js
import { createWorkers } from "@jsenv/workers"

const workers = createWorkers(new URL("./worker.mjs"), {
  minWorkers: 10,
  maxWorkers: 10,
})
```
npm package: @jsep-plugin/arrow
Description: Adds arrow-function support
Author: Shelly
Latest version: 1.0.6

[npm]: https://img.shields.io/npm/v/@jsep-plugin/arrow
[npm-url]: https://www.npmjs.com/package/@jsep-plugin/arrow
[size]: https://packagephobia.now.sh/badge?p=@jsep-plugin/arrow
[size-url]: https://packagephobia.now.sh/result?p=@jsep-plugin/arrow

[![npm][npm]][npm-url]
[![size][size]][size-url]

# @jsep-plugin/arrow

A JSEP plugin for adding arrow-function support. Allows expressions of the form:

```javascript
jsep('a.find(v => v === 1)');
jsep('a.map((v, i) => i)');
jsep('a.map(() => true)');
```

## Install

```console
npm install @jsep-plugin/arrow
# or
yarn add @jsep-plugin/arrow
```

## Usage
```javascript
import jsep from 'jsep';
import jsepArrow from '@jsep-plugin/arrow';
jsep.plugins.register(jsepArrow);
```

## Meta

[LICENSE (MIT)](/LICENSE)
npm package: @jsep-plugin/assignment
Description: Adds assignment expression support
Author: Shelly
Latest version: 1.3.0

[npm]: https://img.shields.io/npm/v/@jsep-plugin/assignment
[npm-url]: https://www.npmjs.com/package/@jsep-plugin/assignment
[size]: https://packagephobia.now.sh/badge?p=@jsep-plugin/assignment
[size-url]: https://packagephobia.now.sh/result?p=@jsep-plugin/assignment

[![npm][npm]][npm-url]
[![size][size]][size-url]

# @jsep-plugin/assignment

A JSEP plugin for adding assignment expression support. Allows expressions of the form:

```javascript
jsep('a = 2');
jsep('a += 2');
jsep('a++');
jsep('--aa');
```

## Install

```console
npm install @jsep-plugin/assignment
# or
yarn add @jsep-plugin/assignment
```

## Usage
```javascript
import jsep from 'jsep';
import jsepAssignment from '@jsep-plugin/assignment';
jsep.plugins.register(jsepAssignment);
```

## Meta

[LICENSE (MIT)](/LICENSE)
npm package: @jsep-plugin/async-await
Description: Adds async/await support
Author: Shelly
Latest version: 1.0.3

[npm]: https://img.shields.io/npm/v/@jsep-plugin/async-await
[npm-url]: https://www.npmjs.com/package/@jsep-plugin/async-await
[size]: https://packagephobia.now.sh/badge?p=@jsep-plugin/async-await
[size-url]: https://packagephobia.now.sh/result?p=@jsep-plugin/async-await

[![npm][npm]][npm-url]
[![size][size]][size-url]

# @jsep-plugin/async-await

A JSEP plugin for adding async/await support. Allows expressions of the form:

```javascript
jsep('await a');
jsep('await a.find(async (v1, v2) => await v1(v2))');
```

## Install

```console
npm install @jsep-plugin/async-await
# or
yarn add @jsep-plugin/async-await
```

## Usage
```javascript
import jsep from 'jsep';
import jsepAsyncAwait from '@jsep-plugin/async-await';
jsep.plugins.register(jsepAsyncAwait);
```

## Meta

[LICENSE (MIT)](/LICENSE)
npm package: @jsep-plugin/comment
Description: Adds comment expression support
Author: Shelly
Latest version: 1.0.4

[npm]: https://img.shields.io/npm/v/@jsep-plugin/comment
[npm-url]: https://www.npmjs.com/package/@jsep-plugin/comment
[size]: https://packagephobia.now.sh/badge?p=@jsep-plugin/comment
[size-url]: https://packagephobia.now.sh/result?p=@jsep-plugin/comment

[![npm][npm]][npm-url]
[![size][size]][size-url]

# @jsep-plugin/comment

A JSEP plugin for adding comment expression support. Allows expressions of the form:

```javascript
jsep('a = 2 // end of line comment');
jsep('a /* ignore this */ += 2');
jsep('a /* ignore \n this */ ++');
```

## Install

```console
npm install @jsep-plugin/comment
# or
yarn add @jsep-plugin/comment
```

## Usage
```javascript
import jsep from 'jsep';
import jsepComment from '@jsep-plugin/comment';
jsep.plugins.register(jsepComment);
```

## Meta

[LICENSE (MIT)](/LICENSE)
npm package: @jsep-plugin/new
Description: Adds 'new' expression support
Author: Shelly
Latest version: 1.0.4

[npm]: https://img.shields.io/npm/v/@jsep-plugin/new
[npm-url]: https://www.npmjs.com/package/@jsep-plugin/new
[size]: https://packagephobia.now.sh/badge?p=@jsep-plugin/new
[size-url]: https://packagephobia.now.sh/result?p=@jsep-plugin/new

[![npm][npm]][npm-url]
[![size][size]][size-url]

# @jsep-plugin/new

A JSEP plugin for adding `new` expression support. Allows expressions of the form:

```javascript
jsep('new Date()');
jsep('new RegExp("^\d+$")');
```

## Install

```console
npm install @jsep-plugin/new
# or
yarn add @jsep-plugin/new
```

## Usage
```javascript
import jsep from 'jsep';
import jsepNew from '@jsep-plugin/new';
jsep.plugins.register(jsepNew);
```

## Meta

[LICENSE (MIT)](/LICENSE)
npm package: @jsep-plugin/numbers
Description: Adds support for binary, hex, and octal number formats, including _
Author: Shelly
Latest version: 1.0.2

[npm]: https://img.shields.io/npm/v/@jsep-plugin/numbers
[npm-url]: https://www.npmjs.com/package/@jsep-plugin/numbers
[size]: https://packagephobia.now.sh/badge?p=@jsep-plugin/numbers
[size-url]: https://packagephobia.now.sh/result?p=@jsep-plugin/numbers

[![npm][npm]][npm-url]
[![size][size]][size-url]

# @jsep-plugin/numbers

A JSEP plugin for adding support for additional number formats, hexadecimal, binary and octal.
It also adds support to ignore _ characters in numbers 

```javascript
jsep('0xA'); // hexadecimal (10)  
jsep('0b01001010'); // binary (74)
jsep('0644'); // octal (420)
jsep('0o644'); // octal (420)
jsep('115_200'); // decimal (115200)
```

## Install

```console
npm install @jsep-plugin/numbers
# or
yarn add @jsep-plugin/numbers
```

## Usage
```javascript
import jsep from 'jsep';
import jsepNumbers from '@jsep-plugin/numbers';
jsep.plugins.register(jsepNumbers);
```

## Meta

[LICENSE (MIT)](/LICENSE)
npm package: @jsep-plugin/object
Description: Adds object expression support
Author: Shelly
Latest version: 1.2.2

[npm]: https://img.shields.io/npm/v/@jsep-plugin/object
[npm-url]: https://www.npmjs.com/package/@jsep-plugin/object
[size]: https://packagephobia.now.sh/badge?p=@jsep-plugin/object
[size-url]: https://packagephobia.now.sh/result?p=@jsep-plugin/object

[![npm][npm]][npm-url]
[![size][size]][size-url]

# @jsep-plugin/object

A JSEP plugin for adding object expression support. Allows expressions of the form:

```javascript
jsep('{ a: 1, b: { c }}[d]');
```

## Install

```console
npm install @jsep-plugin/object
# or
yarn add @jsep-plugin/object
```

## Usage
```javascript
import jsep from 'jsep';
import jsepObject from '@jsep-plugin/object';
jsep.plugins.register(jsepObject);
```

## Meta

[LICENSE (MIT)](/LICENSE)
npm package: @jsep-plugin/regex
Description: Adds regex expression support
Author: Shelly
Latest version: 1.0.4

[npm]: https://img.shields.io/npm/v/@jsep-plugin/regex
[npm-url]: https://www.npmjs.com/package/@jsep-plugin/regex
[size]: https://packagephobia.now.sh/badge?p=@jsep-plugin/regex
[size-url]: https://packagephobia.now.sh/result?p=@jsep-plugin/regex

[![npm][npm]][npm-url]
[![size][size]][size-url]

# @jsep-plugin/regex

A JSEP plugin for adding regex expression support. Allows expressions of the form:

```javascript
jsep('/abc/');
jsep('/abc/ig');
jsep('/[a-z]{3}/ig.test(a)');
```

## Install

```console
npm install @jsep-plugin/regex
# or
yarn add @jsep-plugin/regex
```

## Usage
```javascript
import jsep from 'jsep';
import jsepRegex from '@jsep-plugin/regex';
jsep.plugins.register(jsepRegex);
```

## Meta

[LICENSE (MIT)](/LICENSE)
npm package: @jsep-plugin/spread
Description: Adds spread (...) expression support
Author: Shelly
Latest version: 1.0.3

[npm]: https://img.shields.io/npm/v/@jsep-plugin/spread
[npm-url]: https://www.npmjs.com/package/@jsep-plugin/spread
[size]: https://packagephobia.now.sh/badge?p=@jsep-plugin/spread
[size-url]: https://packagephobia.now.sh/result?p=@jsep-plugin/spread

[![npm][npm]][npm-url]
[![size][size]][size-url]

# @jsep-plugin/spread

A JSEP plugin for adding spread expression support. Allows expressions of the form:

```javascript
jsep('fn(1, ...a)');
jsep('{ ...a }');
jsep('[...a]');
```

## Install

```console
npm install @jsep-plugin/spread
# or
yarn add @jsep-plugin/spread
```

## Usage
```javascript
import jsep from 'jsep';
import jsepSpread from '@jsep-plugin/spread';
jsep.plugins.register(jsepSpread);
```

## Meta

[LICENSE (MIT)](/LICENSE)
npm package: @jsep-plugin/template
Description: Adds template literal expression support
Author: Shelly
Latest version: 1.0.5

[npm]: https://img.shields.io/npm/v/@jsep-plugin/template
[npm-url]: https://www.npmjs.com/package/@jsep-plugin/template
[size]: https://packagephobia.now.sh/badge?p=@jsep-plugin/template
[size-url]: https://packagephobia.now.sh/result?p=@jsep-plugin/template

[![npm][npm]][npm-url]
[![size][size]][size-url]

# @jsep-plugin/template

A JSEP plugin for adding template literal expression support. Allows expressions of the form:

```javascript
jsep('`hi ${name}`');
jsep('msg`hi ${name}`');
```

## Install

```console
npm install @jsep-plugin/template
# or
yarn add @jsep-plugin/template
```

## Usage
```javascript
import jsep from 'jsep';
import jsepTemplateLiteral from '@jsep-plugin/template';
jsep.plugins.register(jsepTemplateLiteral);
```

## Meta

[LICENSE (MIT)](/LICENSE)
npm package: @jsep-plugin/ternary
Description: Adds ternary expression support
Author: Shelly
Latest version: 1.1.4

[npm]: https://img.shields.io/npm/v/@jsep-plugin/ternary
[npm-url]: https://www.npmjs.com/package/@jsep-plugin/ternary
[size]: https://packagephobia.now.sh/badge?p=@jsep-plugin/ternary
[size-url]: https://packagephobia.now.sh/result?p=@jsep-plugin/ternary

[![npm][npm]][npm-url]
[![size][size]][size-url]

# @jsep-plugin/ternary

A JSEP plugin for adding ternary expression support. Allows expressions of the form:

```javascript
jsep('a ? 1 : 2');
```

## Install

```console
npm install @jsep-plugin/ternary
# or
yarn add @jsep-plugin/ternary
```

## Usage
```javascript
import jsep from 'jsep';
import jsepTernary from '@jsep-plugin/ternary';
jsep.plugins.register(jsepTernary);
```

## Meta

[LICENSE (MIT)](/LICENSE)
npm package: @jsercai/tool-kit
Description: 前端工具包
Author: JserCai
Latest version: 0.0.3

<h1 align="center">前端常用函数工具包</h1>

<p align="center">汇总常用函数工具包</p>

<p align="center">
    <img alt="GitHub language count" src="https://img.shields.io/github/languages/count/daddycai/ToolKit" />
    <img src="https://img.shields.io/github/languages/top/daddycai/ToolKit?style=flat-square&color=green"  alt="GitHub top language" />
    <img src="https://img.shields.io/badge/dynamic/json?color=green&label=github&query=%24.data.totalSubs&url=https%3A%2F%2Fapi.spencerwoo.com%2Fsubstats%2F%3Fsource%3Dgithub%26queryKey%3Ddaddycai&style=flat-square&logo=github" />
    <img alt="GitHub commit activity" src="https://img.shields.io/github/commit-activity/m/daddycai/ToolKit?color=yellow">
</p>

---

## 简介

前端项目开发中，会经常使用一些工具函数，随着项目数量的增多、工具函数的增多，在每个项目里面都维护一个 util.js 会带来不少的麻烦，所以还是维护一个工具函数包，希望大家也一并 commit!

## 安装使用

### 1. 安装包使用方式

安装

```shell
# npm
npm install @jsercai/tool-kit -S

# yarn
yarn add @jsercai/tool-kit -S
```

ESM 导入使用

```js
import { random } from '@jsercai/tool-kit'
console.log(random(1, 10))
```

RequireJS 导入使用

```js
const { random } = require('@jsercai/tool-kit')
console.log(random(1, 10))
```

### 2. 网页 script 直接引入使用方式

直接拷贝 dist 下的 tool-kit-umd.js 到项目里面，可直接引用

```html
<!DOCTYPE html>
<html lang="en">
  <body>
    <script src="/dist/tool-kit-umd.js"></script>
    <script>
      console.log(dutils.random(1, 10))
    </script>
  </body>
</html>
```

## 函数概览

```js
  /**
   * 生成数字范围内的随机数
   * @param min 最小数字
   * @param max 最大数字
   * @returns number类型
   */
  export function random(min: number, max: number): number
  /**
   * 时间字符串转换为时间戳
   * @param dateStr 字符串格式为 2017-02-10 18:20:30
   * 注意：此处月、日、时分秒、必须为2位数字，否则报错
   * @returns 时间戳
   */
```
npm package: @jserwang/scripts
Description: 脚本集合
Author: JserWang
Latest version: 1.1.5

脚本集合

## 安装

```bash
pnpm add @jserwang/scripts -D
```

## 使用
在`package.json`中的`scripts`添加：

1. 根据`yapi`生成接口
```bash
jserwang api --token ${REPLACE_TOKEN} --host ${REPLACE_HOST} --path ${REPLACE_TARGET_PATH --type ${REPLACE_TYPE} --prefix ${REPLACE_API_PREFIX} 
```
如：
```bash
jserwang api --token xxxx --host https://xxx --path /test/api --type YAPI --prefix /mobile
```
## 注意

- 当工具发出 `发现后端定义接口参数类型异常，接口地址为: 'xxxx'`时，请及时找后端询问是否参数定义存在问题，正常来说，请求参数应明确类型。
npm package: @jserwang/utils
Description: [![NPM version](https://img.shields.io/npm/v/@jserwang/utils?color=a1b858&label=)](https://www.npmjs.com/package/@jserwang/utils) [![Docs](https://www.paka.dev/badges/v0/cute.svg)](https://www.paka.dev/npm/@jserwang/utils)
Author: JserWang
Latest version: 1.1.1

# @jserwang/utils

[![NPM version](https://img.shields.io/npm/v/@jserwang/utils?color=a1b858&label=)](https://www.npmjs.com/package/@jserwang/utils)
[![Docs](https://www.paka.dev/badges/v0/cute.svg)](https://www.paka.dev/npm/@jserwang/utils)

Opinionated collection of common JavaScript / TypeScript utils by [@JserWang](https://github.com/jserwang).

- Tree-shakable ESM
- Fully typed - with TSDocs
- Type utilities - `MaybeArray<T>`, `ElementOf<T>`, etc.
npm package: @jserxiao/xcli
Description: A pluggable CLI tool for scaffolding TypeScript projects
Author: jserxiao
Latest version: 1.0.21

# xcli

一个可插拔的 TypeScript 项目脚手架 CLI 工具，让你快速搭建现代化的 TypeScript 项目。

## 特性

- 🚀 **快速初始化** - 一键创建完整的 TypeScript 项目结构
- 🔌 **可插拔配置** - 自由选择需要的工具和配置
- 📦 **丰富的插件** - 内置多种常用开发工具配置
- 🎯 **开箱即用** - 生成的项目可直接投入开发

## 安装

```bash
# 全局安装
npm install -g xcli

# 或使用 npx
npx xcli init my-project
```

## 使用

### 初始化项目

```bash
# 交互式创建项目
xcli init my-project

# 使用默认配置创建项目
xcli init my-project --default

# 指定包管理器
xcli init my-project -p pnpm

# 跳过依赖安装
xcli init my-project --skip-install

# 跳过 Git 初始化
xcli init my-project --skip-git
```

### 管理插件

```bash
# 查看所有可用插件
xcli plugin list

# 添加插件
xcli plugin add eslint prettier

# 移除插件
xcli plugin remove eslint
```

### 升级 CLI

```bash
# 检查是否有更新
xcli upgrade --check

# 升级到最新版本
xcli upgrade

# 查看当前版本
xcli version
```

## 可用插件

### 代码检查
- **ESLint** - JavaScript/TypeScript 代码检查工具

### 代码格式化
- **Prettier** - 代码格式化工具

### 测试框架
- **Jest** - JavaScript 测试框架
- **Vitest** - 下一代测试框架（更快、兼容 Vite）

### Git 工具
- **Husky + lint-staged** - Git Hooks 和代码提交前自动检查
- **Commitlint** - Git 提交信息规范检查

### 构建打包
- **Vite** - 下一代前端构建工具
- **Webpack** - 模块打包工具
- **Rollup** - JavaScript 模块打包器

### 其他
- **TypeScript** - TypeScript 编译配置（默认启用）

## 项目结构

使用 xcli 创建的项目结构：

```
my-project/
├── src/
│   └── index.ts          # 入口文件
├── dist/                  # 编译输出
├── package.json
├── tsconfig.json
├── .gitignore
└── README.md
```

根据选择的插件，还会生成相应的配置文件：

```
my-project/
├── .eslintrc.json        # ESLint 配置
├── .prettierrc           # Prettier 配置
├── jest.config.js        # Jest 配置
├── vitest.config.ts      # Vitest 配置
├── vite.config.ts        # Vite 配置
├── webpack.config.js     # Webpack 配置
├── rollup.config.mjs     # Rollup 配置
├── .husky/               # Git Hooks
│   └── pre-commit
├── .commitlintrc.json    # Commitlint 配置
└── ...
```

## 开发

```bash
# 克隆仓库
git clone https://github.com/your-username/xcli.git

# 安装依赖
npm install

# 编译
npm run build

# 运行
node dist/index.js init test-project
```

## License

MIT
npm package: @jsewell/discord-giveaways-super
Description: Fork of discord giveaways super for LA
Author: Jacob Sewell
Latest version: 1.1.5

# Discord Giveaways Super

[![Downloads](https://img.shields.io/npm/dt/discord-giveaways-super?style=for-the-badge)](https://www.npmjs.com/package/discord-giveaways-super)
[![Stable Version](https://img.shields.io/npm/v/discord-giveaways-super?style=for-the-badge)](https://www.npmjs.com/package/discord-giveaways-super)
[![Build Status](https://github.com/shadowplay1/discord-economy-super/workflows/build/badge.svg)](https://www.npmjs.com/package/discord-giveaways-super)

**Discord Giveaways Super** - Create and manage giveaways in [Discord](https://old.discordjs.dev/#/).

## ❓ | Why **Discord Giveaways Super**?
- Clean TypeScript Defenitions 📘
- Multiple Databases Support 🍃
- Object-Oriented 📝
- Flexible and Customizable ⚙️
- Giveaway __start__, __edit__, __delete__, __reroll__, __extension__ and *many more* 🚀
- Handles Crashes/Restarts 🔄
- Database Caching System 📚
- Easy to Understand 👍
- Beginner Friendly 😄
- High Performance 💨

## 📂 | Installation
**Node.js v16.9.0 or newer is required to install.**

```console
$ npm i discord-giveaways-super
$ yarn add discord-giveaways-super
$ pnpm add discord-giveaways-super
```

## [[Module Documentation]](https://dgs-docs.js.org)

## 🛠️ | Examples
**Full bot examples** in both **JavaScript** and **TypeScript** are available [here](https://github.com/shadowplay1/discord-giveaways-super/tree/main/examples).

## 🤔 | Help
**If you don't understand something in the documentation or you are experiencing problems, feel free to join our [Support Server](https://discord.gg/4pWKq8vUnb)**.

## 🕘 | My Other Modules
- [discord-economy-super](https://www.npmjs.com/package/discord-economy-super)
- [discord-achievements](https://www.npmjs.com/package/discord-achievements)
- [quick-mongo-super](https://www.npmjs.com/package/quick-mongo-super)
- [discord-leveling-super](https://www.npmjs.com/package/discord-leveling-super)

## ❗ | Useful Links
- [Documentation](https://dgs-docs.js.org)
- [NPM](https://www.npmjs.com/package/discord-giveaways-super)
- [Frequently Asked Questions](https://dgs-docs.js.org/#/docs/main/1.1.0/general/faq)
- [GitHub](https://github.com/shadowplay1/discord-giveaways-super)
- [Examples](https://github.com/shadowplay1/discord-giveaways-super/tree/main/examples)
- [Discord Server](https://discord.gg/4pWKq8vUnb)

**If you don't understand something in the documentation or you are experiencing problems, feel free to join our [Support Server](https://discord.gg/4pWKq8vUnb)**.

**Module Created by ShadowPlay (*@shadowplay_* in discord).**

# ❤️ Thanks for choosing Discord Giveaways Super ❤️
npm package: @jsewell/discord-giveaways-super-fork
Description: Fork of discord giveaways super for LA
Author: Jacob Sewell
Latest version: 1.0.4

# Discord Giveaways Super

[![Downloads](https://img.shields.io/npm/dt/discord-giveaways-super?style=for-the-badge)](https://www.npmjs.com/package/discord-giveaways-super)
[![Stable Version](https://img.shields.io/npm/v/discord-giveaways-super?style=for-the-badge)](https://www.npmjs.com/package/discord-giveaways-super)
[![Build Status](https://github.com/shadowplay1/discord-economy-super/workflows/build/badge.svg)](https://www.npmjs.com/package/discord-giveaways-super)

**Discord Giveaways Super** - Create and manage giveaways in [Discord](https://old.discordjs.dev/#/).

## ❓ | Why **Discord Giveaways Super**?
- Clean TypeScript Defenitions 📘
- Multiple Databases Support 🍃
- Object-Oriented 📝
- Flexible and Customizable ⚙️
- Giveaway __start__, __edit__, __delete__, __reroll__, __extension__ and *many more* 🚀
- Handles Crashes/Restarts 🔄
- Database Caching System 📚
- Easy to Understand 👍
- Beginner Friendly 😄
- High Performance 💨

## 📂 | Installation
**Node.js v16.9.0 or newer is required to install.**

```console
$ npm i discord-giveaways-super
$ yarn add discord-giveaways-super
$ pnpm add discord-giveaways-super
```

## [[Module Documentation]](https://dgs-docs.js.org)

## 🛠️ | Examples
**Full bot examples** in both **JavaScript** and **TypeScript** are available [here](https://github.com/shadowplay1/discord-giveaways-super/tree/main/examples).

## 🤔 | Help
**If you don't understand something in the documentation or you are experiencing problems, feel free to join our [Support Server](https://discord.gg/4pWKq8vUnb)**.

## 🕘 | My Other Modules
- [discord-economy-super](https://www.npmjs.com/package/discord-economy-super)
- [discord-achievements](https://www.npmjs.com/package/discord-achievements)
- [quick-mongo-super](https://www.npmjs.com/package/quick-mongo-super)
- [discord-leveling-super](https://www.npmjs.com/package/discord-leveling-super)

## ❗ | Useful Links
- [Documentation](https://dgs-docs.js.org)
- [NPM](https://www.npmjs.com/package/discord-giveaways-super)
- [Frequently Asked Questions](https://dgs-docs.js.org/#/docs/main/1.1.0/general/faq)
- [GitHub](https://github.com/shadowplay1/discord-giveaways-super)
- [Examples](https://github.com/shadowplay1/discord-giveaways-super/tree/main/examples)
- [Discord Server](https://discord.gg/4pWKq8vUnb)

**If you don't understand something in the documentation or you are experiencing problems, feel free to join our [Support Server](https://discord.gg/4pWKq8vUnb)**.

**Module Created by ShadowPlay (*@shadowplay_* in discord).**

# ❤️ Thanks for choosing Discord Giveaways Super ❤️
npm package: @jsextends/jevent
Description: 这是一个javascript事件的实现
Author: usernameisregistered
Latest version: 1.1.0

# JEvent
这是一个关于event的实现

---

*author* : **usernameisregistered**

*email*：**liming_longxi@163.com**

*buildDate*:**2019年10月27日 12:51**

---

## 安装  npm i @jsextends/jevent

## 引入

```
import { JEvent, JErrorEvent, JEventTarget } from "@jsextends/jevent"

```

## 文档

[doc](https://github.com/jsextends/JEvent/wiki)

## 示例
[示例](./example.html)


## 注意
| 函数名称 | 描述 | 参数 |
| - | - | - |
| apply | 方法调用一个具有给定this值的函数 | thisArg, [argsArray] |
| call | 使用一个指定的 this 值和单独给出的一个或多个参数来调用一个函数 | thisArg, arg1, arg2, ... |
| bind | 会创建一个新绑定函数 | thisArg[,arg1[,arg2[, ...]]] |

### 事件阶段常量
| 常量 | 值 | 描述 |
| - | - | - |
|Event.NONE|	0	|这个时间，没有事件正在被处理|
|Event.CAPTURING_PHASE|	1	|事件正在被目标元素的祖先对象处理. 这个处理过程从Window开始，然后Document, 然后是HTMLHtmlElement, 一直这样，直到目标元素的父元素。 通过EventTarget.addEventListener() 注册为捕获模式的Event listeners 被调用。|
|Event.AT_TARGET	|2	|事件对象已经抵达the event's target. 为这个阶段注册的事件监听被调用。 如果 Event.bubbles 的值为false, 对事件对象的处理在这个阶段后就会结束.|
|Event.BUBBLING_PHASE	|3	|事件对象逆向向上传播回目标元素的祖先元素, 从父亲元素开始，并且最终到达包含元素 Window. 这就是冒泡，并且只有Event.bubbles 值为true的时候才会发生。 为这个阶段注册的Event listeners 在这个过程中被触发|

### 绑定函数[bound function，BF]
**BoundTargetFunction** - 包装的函数对象
**BoundThis** - 在调用包装函数时始终作为this值传递的值。
**BoundArguments** - 列表，在对包装函数做任何调用都会优先用列表元素填充参数列表。
**Call** - 执行与此对象关联的代码。通过函数调用表达式调用。内部方法的参数是一个this值和一个包含通过调用表达式传递给函数的参数的列表。

绑定函数也可以使用new运算符构造，它会表现为目标函数已经被构建完毕了似的。提供的this值会被忽略，但前置参数仍会提供给模拟函数。
npm package: @jsextends/ji18n
Description: 这是一个国际化的库
Author: usernameisregistered
Latest version: 1.1.0

# JI18n
这是一个国际化的库

## 安装 
`npm i @jsextends/ji18n`

## 引入

```
import { JI18n } from "@jsextends/ji18n"
```

## 文档

[api](./api.md)

## 示例

[example](./example/index.html)
npm package: @jsextonn/portfolio-api-client
Description: NodeJS client for portfolio API
Author: Justin Sexton
Latest version: 0.5.0

# Portfolio API NodeJS Client

![](https://github.com/jsexton-portfolio/portfolio-api-nodejs-client/workflows/build/badge.svg)

NodeJS client used to interface with Portfolio APIs.

## Installation

`npm i @jsextonn/portfolio-api-client`

Note: Package is currently not distributed with minified version.

## Usage

### Contact Message Creation

```ts
import {
  portfolio,
  Reason,
  CreateContactMessageRequest,
} from "@jsextonn/portfolio-api-client";

const client = portfolio();

const request: CreateContactMessageRequest = {
  body: {
    message: "...",
    reason: Reason.Question,
    sender: {
      alias: "...",
      phone: "...",
      email: "...",
    },
  },
};

// The response entity returned from the web service
const response = await client.contact.createMessage(request);

// The response body
const responseBody = response.data;

// The newly created message, if successful
const message = responseBody.data;
```

### Login

```ts
import { portfolio, LoginRequest } from "@jsextonn/portfolio-api-client";

const client = portfolio();

const request: LoginRequest = {
  body: {
    username: "username",
    password: "password",
  },
};

// The response entity returned from the web service
const response = await client.security.login(request);

// The response body
const responseBody = response.data;

// The authentication tokens, if successful
const message = responseBody.data;
```

### Confirm Account

```ts
import {
  portfolio,
  UpdatePasswordRequest,
} from "@jsextonn/portfolio-api-client";

const client = portfolio();

const request: UpdatePasswordRequest = {
  body: {
    username: "username",
    oldPassword: "oldPassword",
    newPassword: "newPassword",
  },
};

// The response entity returned from the web service
const response = await client.security.confirmAccount(request);

// The response body
const responseBody = response.data;

// The authentication tokens, if successful
const message = responseBody.data;
```