open-index/open-npm huggingface dataset:
npm package: @js-ql/scaffold
Description: A library that is used to generate object blueprints. Inspired by graphql
Author: lloydaf
Latest version: 1.1.2

# <img src="assets/jsql.svg" alt="JSQL Logo" width="100" height="100" align="center">Scaffold

[![npm version](https://badge.fury.io/js/%40js-ql%2Fscaffold.svg)](https://badge.fury.io/js/%40js-ql%2Fscaffold)

Scaffold is a JavaScript library that is used to generate objects using templates inspired from GraphQL.

## Installation

```console
npm install --save @js-ql/scaffold
```

## Usage

### Simple Usage

```javascript
const { scaffold } = require('@js-ql/scaffold')

const queryString = `
{
  name
  age
}`

console.log(scaffold(queryString))

/*
{
  name: null,
  age: null
}
 */



```

### With Types

```javascript
const { scaffold } = require('@js-ql/scaffold')

const queryString = `
{
  name: String
  friends: Array
}
`


console.log(scaffold(queryString))
/*
{
  name: '',
  friends: [],
}
*/

```

### By Defining Schemas

```javascript
const { Registry } = require('@js-ql/scaffold')

const queryString = `
define Person {
  name: String
  friends: Array
}
`
// Initial Registration

Registry.register(queryString)

.
.
.

// When you need it

console.log(Registry.scaffold('Person'))

/*
{
  name: '',
  friends: [],
}
*/

```

### Multiple Schemas

```javascript
const { Registry } = require('@js-ql/scaffold')

const queryString = `
  define Friend {
    name
    age
  }
  define Person {
    name: String
    friends: Array
    bestFriend: Friend
  }`


Registry.register(queryString)

.
.
.

console.log(Registry.scaffold('Person'))

/*
{
  name: '',
  friends: [],
  bestFriend: {
    name: null,
    age: null
  }
}
*/

```

Note: Make sure that schemas that you want to use inside another schema are defined before you use it.
npm package: @js-random/all
Description: A collection of simple and lightweight randomizers for JavaScript (TypeScript friendly)
Author: Raiondesu
Latest version: 0.3.5

# @js-random/all

> A collection of simple and lightweight randomizers for JavaScript (TypeScript friendly)

## Packages

Here's a list of packages that are included in this build:

- `@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/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)

## Installation

For each individual package - see links above.

If you want everything at once, just do:
```
npm i -S @js-random/all
```

## Usage

There are two ways to use `@js-random/all`: imported and global.

### Imported

This way you need to import the object containing all the randomizers yourself:

**commonjs**:
```js
// Every @js-random package is contained in this object by their respective name
const random = require('@js-random/all');
```

**TS/ES6+**
```ts
import * as random from '@js-random/all';
```

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

```ts
// For example - `@js-random/number` and `@js-random/boolean`:
const randomNumber = random.number(0, 10); // random number from 0 to 10 (inclusive)
const randomBoolean = random.boolean();    // half the chance of getting `true` or `false`
const probablyTrue = random.boolean(0.99); // 99% of getting `true`
```

### Global

This setup introduces side-effects: each package's function is inserted into global constructors as `random()` method:

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

**ES6+**
```js
import '@js-random/all/module/global';
```

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

and then:

```ts
const randomNumber = Number.random(0, 10);
const probablyTrue = Boolean.random(0.99); // 99% of getting `true`
// Same is true for String, Date and etc.
```