open-index/open-npm huggingface dataset:
npm package: @js-random/date
Description: A simple and lightweight date randomizer for JavaScript (TypeScript friendly)
Author: Raiondesu
Latest version: 0.3.5

# `@js-random/date`

> A simple and lightweight date randomizer for JavaScript (TypeScript friendly)

## Installation

```
npm i -S @js-random/date
```

## Usage

**commonjs**:
```js
var randomDate = require('@js-random/date').default;
```

**TS/ES6+**:
```ts
import randomDate from '@js-random/date';
```

**`<script> tag`**:
```html
<script src="https://unpkg.com/@js-random/date"></script>
```

```js
var date = randomDate(); // A random date, basically
var from2010To2012 = randomDate({ from: new Date(2010, 1, 1), to: new Date(2010, 1, 1) }); // random date from Jan 1 2010 to Jan 1 2012
```


## Global version

This package also has a global version, which introduces side-effects by exposing the api as `Date.random()` function.

### Import

**commonjs**:
```js
require('@js-random/date/lib/global');
```

**ES6+**:
```ts
import '@js-random/date/module/global';
```

**TS**:
```ts
import '@js-random/date/module/global';
```

**`<script> tag`**
```html
<script src="https://unpkg.com/@js-random/date/unpkg/global"></script>
```

### Usage

```js
var date = Date.random(); // A random date, basically
var from2010To2012 = Date.random({ from: new Date(2010, 1, 1), to: new Date(2010, 1, 1) }); // random date from Jan 1 2010 to Jan 1 2012
```

## Other packages

Please, have a look at other packages from `@js-random` series:

- `@js-random/all` - all the randomizers in one package - [GitHub repo](https://github.com/Raiondesu/js-random/tree/master/packages/all#readme), [NPM](https://www.npmjs.com/@js-random/string)
- `@js-random/number` [GitHub repo](https://github.com/Raiondesu/js-random/tree/master/packages/number#readme), [NPM](https://www.npmjs.com/@js-random/number)
- `@js-random/boolean` [GitHub repo](https://github.com/Raiondesu/js-random/tree/master/packages/boolean#readme), [NPM](https://www.npmjs.com/@js-random/boolean)
- `@js-random/string` [GitHub repo](https://github.com/Raiondesu/js-random/tree/master/packages/string#readme), [NPM](https://www.npmjs.com/@js-random/string)
npm package: @js-random/global
Description: A collection of simple and lightweight randomizers for JavaScript integrated into the native API (TypeScript friendly)
Author: Raiondesu
Latest version: 0.1.2
Deprecated: Please, use @js-random/all instead!

# `@js-random/global`

> A collection of simple and lightweight randomizers for JavaScript integrated into the native API (TypeScript friendly)

## Installation

```
npm i -S @js-random/global
```

## Usage

Upon importing, the main JS constructors (`Number`, `String`, `Date`, `Boolean`) will recieve a `random` function, which is equivalent to a corresponding `@js-random` package:

**commonjs**:
```js
require('@js-random/global');
```

**TS/ES6+**
```ts
import '@js-random/global';
```

**result**:
```ts
Number.random();  // 42
String.random();  // "@!f33D s)97"
Date.random();    // 23 May 7562 01:41:12:632
Boolean.random(); // false
```

It is also possible to globalize each package individually, by adding a `/` with the original `@js-random/*` package name to the `@js-random/global`:

```ts
import '@js-random/global/number';

Number.random();  // 42
String.random();  // TypeError: 'random' is not a function
Date.random();    // TypeError: 'random' is not a function
Boolean.random(); // TypeError: 'random' is not a function
```

---

One could also want to use this via a `<script>` tag. This is possible using `unpkg`:

```html
<!-- For all packages -->
<script src="https://unpkg.com/@js-random/global"></script>

<!-- For a specific package -->
<script src="https://unpkg.com/@js-random/global/unpkg/number"></script>
<script src="https://unpkg.com/@js-random/global/unpkg/string"></script>
<script src="https://unpkg.com/@js-random/global/unpkg/boolean"></script>
<script src="https://unpkg.com/@js-random/global/unpkg/date"></script>
```
npm package: @js-random/number
Description: A simple and lightweight number randomizer for JavaScript (TypeScript friendly)
Author: Raiondesu
Latest version: 0.3.5

# `@js-random/number`

> A simple and lightweight number randomizer for JavaScript (TypeScript friendly)

## Installation

```
npm i -S @js-random/number
```

## Usage

**commonjs**:
```js
var randomNumber = require('@js-random/number').default;
```

**TS/ES6+**:
```ts
import randomNumber from '@js-random/number';
```

**`<script> tag`**:
```html
<script src="https://unpkg.com/@js-random/number"></script>
```

```ts
var number = randomNumber(); // from 0 to 100 (inclusive)
var fromTwoToTen = randomNumber(2, 10); // random number from `2` to `10` (inclusive)
```

## Global version

This package also has a global version, which introduces side-effects by exposing the api as `Number.random()` function.

### Import

**commonjs**:
```js
require('@js-random/number/lib/global');
```

**ES6+**:
```ts
import '@js-random/number/module/global';
```

**TS**:
```ts
import '@js-random/number/module/global';
```

**`<script> tag`**
```html
<script src="https://unpkg.com/@js-random/number/unpkg/global"></script>
```

### Usage

```ts
var number = Number.random(); // from 0 to 100 (inclusive)
var fromTwoToTen = Number.random(2, 10); // random number from `2` to `10` (inclusive)
```

## Other packages

Please, have a look at other packages from `@js-random` series:

- `@js-random/all` - all the randomizers in one package - [GitHub repo](https://github.com/Raiondesu/js-random/tree/master/packages/all#readme), [NPM](https://www.npmjs.com/@js-random/string)
- `@js-random/string` [GitHub repo](https://github.com/Raiondesu/js-random/tree/master/packages/string#readme), [NPM](https://www.npmjs.com/@js-random/string)
- `@js-random/boolean` [GitHub repo](https://github.com/Raiondesu/js-random/tree/master/packages/boolean#readme), [NPM](https://www.npmjs.com/@js-random/boolean)
- `@js-random/date` [GitHub repo](https://github.com/Raiondesu/js-random/tree/master/packages/date#readme), [NPM](https://www.npmjs.com/@js-random/date)
- `@js-random/function` [GitHub repo](https://github.com/Raiondesu/js-random/tree/master/packages/function#readme), [NPM](https://www.npmjs.com/@js-random/function)
npm package: @js-random/string
Description: A simple and lightweight string randomizer for JavaScript (TypeScript friendly)
Author: Raiondesu
Latest version: 0.3.5

# `@js-random/string`

> A simple and lightweight string randomizer for JavaScript (TypeScript friendly)

## Installation

```
npm i -S @js-random/string
```

## Usage

**commonjs**:
```js
var randomString = require('@js-random/string').default;
```

**TS/ES6+**:
```ts
import randomString from '@js-random/string';
```

**`<script> tag`**:
```html
<script src="https://unpkg.com/@js-random/string"></script>
```

```js
// All parameters are optional

// A random 10-symbol string. Probably something like "2P*D:4[T9="
var string = randomString();

// Random string of length 4, with a seed of 'Hello, World!' filtered by /[HW,erld]/ for each symbol
var hell_comma_wrld = randomString(4, 'Hello, World!', /[HW,erld]/);

// Object-style parameter is also available:
hell_comma_wrld = randomString({
  length: 4,
  seed: 'Hello, World!',
  filter: /[HW,erld]/
});
```

## Global version

This package also has a global version, which introduces side-effects by exposing the api as `String.random()` function.

### Import

**commonjs**:
```js
require('@js-random/string/lib/global');
```

**ES6+**:
```ts
import '@js-random/string/module/global';
```

**TS**:
```ts
import '@js-random/string/module/global';
```

**`<script> tag`**
```html
<script src="https://unpkg.com/@js-random/string/unpkg/global"></script>
```

### Usage

```js
// A random 10-symbol string. Probably something like "2P*D:4[T9="
var string = String.random();

// Random string of length 4, with a seed of 'Hello, World!' filtered by /[HW,erld]/ for each symbol
var hell_comma_wrld = String.random(4, 'Hello, World!', /[HW,erld]/);

// Object-style parameter is also available:
hell_comma_wrld = String.random({
  length: 4,
  seed: 'Hello, World!',
  filter: /[HW,erld]/
});
```

## Other packages

Please, have a look at other packages from `@js-random` series:

- `@js-random/all` - all the randomizers in one package - [GitHub repo](https://github.com/Raiondesu/js-random/tree/master/packages/all#readme), [NPM](https://www.npmjs.com/@js-random/string)
- `@js-random/number` [GitHub repo](https://github.com/Raiondesu/js-random/tree/master/packages/number#readme), [NPM](https://www.npmjs.com/@js-random/number)
- `@js-random/boolean` [GitHub repo](https://github.com/Raiondesu/js-random/tree/master/packages/boolean#readme), [NPM](https://www.npmjs.com/@js-random/boolean)
- `@js-random/date` [GitHub repo](https://github.com/Raiondesu/js-random/tree/master/packages/date#readme), [NPM](https://www.npmjs.com/@js-random/date)
npm package: @js-rocks/babel-tiny
Description: a simple babel
Author: chenxiaoyao
Latest version: 0.1.0

# `@js-rocks/babel-tiny`

A simple babel implementation that can be used to parse javascript grammar, include parser, traverser, core and cli.

## Install

```
yarn add @js-rocks/babel-tiny
```

## Usage

define custom plugin and then use

```js
const source = `
    const d = 2;
    const e = 4;
    function add(a, b) {
        const tmp = 1;
        return a + b;
    }
    add(c, d);
`;

function plugin1(api, options) {
  return {
    visitor: {
      Identifier(path) {
        if (path.findParent(p => p.isCallExpression())) {
          path.replaceWith(api.template.expression(options.replaceName));
        }
      }
    }
  };
}

const { code, map } = transformSync(source, {
  plugins: [
    [
      plugin1,
      {
        replaceName: 'minus'
      }
    ]
  ]
});

expect(code.indexOf('minus(c, d)') > -1).toEqual(true);
```
npm package: @js-rocks/jsx-parser-tiny
Description: a runtime jsx parser
Author: chenxiaoyao6228
Latest version: 0.0.1

# @js-rocks/jsx-parser-tiny

A simple runtime JSX-parser

## Note

If you are having a hard time figuring out how the regex work, these sites might help

- [regex-101](https://regex101.com/)
- [regexper](https://regexper.com/)

## Reference

- [jsx spec](https://facebook.github.io/jsx/)
npm package: @js-rocks/ts-toolbelt-tiny
Description: typescript-challenges
Latest version: 0.0.0

# @js-rocks/ts-toolbelt-tiny

Collection of utility types, complementing TypeScript built-in mapped types and aliases (think "lodash" for static types).

> Note: Most of the types are from type challenges, any type start with '\_' (eg: \_Omit) will be exported automatically

## Quick start

Installation

```bash
yarn add @js-rocks/ts-toolbelt-tiny
```

Usage

```
import type {_Omit } from '@js-rocks/ts-toolbelt-tiny';
```

## Table of Contents

- [\_First](./14-easy-first/template.ts)
- [\_Omit](./3-medium-omit/template.ts)
- [\_Pick](./4-easy-pick/template.ts)
- [\_Flatten](./459-medium-flatten/template.ts)
- [\_Merge](./599-medium-merge/template.ts)
- [\_Readonly](./8-medium-readonly-2/template.ts)

## Implementation details

Summaries on [type challenges](https://github.com/type-challenges/)

- [01-pattern-matching](./patterns//01-pattern-matching/template.ts)
- [02-type-transform](./pattens/../patterns/02-type-transform/template.ts)
- [03-recursion](./pattens/../patterns/03-recursion/template.ts)
- [04-arr-length](./pattens/../patterns/04-arr-length/template.ts)
- [05-union-type](./pattens/../patterns/05-union-type/template.ts)
- [06-trivial](./pattens/../patterns/06-trivial/template.ts)

## Reference

- [type challenges](https://github.com/type-challenges/)

* [TypeScript challenges(Chinese)
  ](https://juejin.cn/book/7047524421182947366)

- [lisp interpreter with typescript(Chinese)
  ](https://zhuanlan.zhihu.com/p/427309936)

- [Implement a Chinese chess program
  with typescript(Chinese)](https://zhuanlan.zhihu.com/p/426966480)
npm package: @js-rocks/vue-tiny
Description: build your own vue3
Author: chenxiaoyao6228
Latest version: 0.2.0

# @js-rocks/vue-tiny

A minimal vue3 implementation, including three core modules: `Reactivity`, `Runtime compiler`, `Runtime dom`.

## Features

- 👽 Reactivity: A complete reactive-system(isReactive, isProxy, isRef, scheduler, computed, watch and etc)
- 😈 Compiler: A tiny runtime compiler with limited features(text, interpolation, element)
- 💥 Runtime dom: custom renderer support

## Installation

```sh
yarn add @js-rocks/vue-tiny
```

## Online Demo

<iframe src="https://codesandbox.io/embed/vue-tiny-counter-fj4zhx?fontsize=14&hidenavigation=1&theme=dark"
     style="width:100%; height:300px; border:0; border-radius: 4px; overflow:hidden;"
     title="vue-tiny-counter"
     allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking"
     sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
   ></iframe>

For more, please checkout the [examples ](./examples/) folder

## Implementation details

- [compiler](./docs/compiler.md)

## Reference

- [vue 设计与实现](https://book.douban.com/subject/35768338/)
- [mini-vue](https://github.com/cuixiaorui/mini-vue)