# data-spring-cli

> Data Spring generates fake datasets geared towards dashboards and data visualizations.

Latest version **0.1.11** (published 2020-12-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install data-spring-cli
pnpm add data-spring-cli
yarn add data-spring-cli
bun add data-spring-cli
```

Provides the command `data-spring`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.11 |
| Published | 2020-12-22 |
| First published | 2020-10-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 6.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | tylerben |
| Maintainers | tylerben |
| Keywords | data, data generator, fake data, typescript, javascript, data-spring, generator, mock data, mock, dummy data, dummy, dashboard, data visualization |

## Links

- npm: https://www.npmjs.com/package/data-spring-cli
- Repository: https://github.com/tylerben/data-spring
- Homepage: https://github.com/tylerben/data-spring#readme
- Issues: https://github.com/tylerben/data-spring/issues
- npm.io page: https://npm.io/package/data-spring-cli

## Dependencies (3)

- [yargs](https://npm.io/package/yargs.md) ^16.0.3
- [yargonaut](https://npm.io/package/yargonaut.md) ^1.1.4
- [data-spring](https://npm.io/package/data-spring.md) ^0.1.11

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.1.11 (latest) — 2020-12-22
- 0.1.10 — 2020-12-22
- 0.1.9 — 2020-12-22
- 0.1.8 — 2020-12-18
- 0.1.7 — 2020-12-18
- 0.1.5 — 2020-12-18
- 0.1.4 — 2020-10-12
- 0.1.3 — 2020-10-12
- 0.1.0 — 2020-10-12

## README

# Data Spring

> :warning: Data Spring is still very much in an experimental and beta state. As a result, features and implementation likely will change.

Data Spring generates fake datasets geared towards dashboards and data visualizations. Sure a lot of libraries already exist for generating fake data, but I was not able to find a solution that was well tailored for these use cases. Data Spring is designed with the use case of generating datasets for prototyping data driven dashboards and data visualizations. As a result, it is fast and easy to create things like large time series datasets using Data Spring.

Data Spring is available both as a JavaScript library as well as a standalone CLI. Instructions for using both are included below

## Getting Started

The Data Spring command-line interface (CLI) can be used generate fake datasets from a provided json config file and output the results to a specified json file.

Install the package globally using yarn or npm.

```shell
# yarn
yarn global add data-spring-cli

#npm
npm install data-spring-cli -g
```

Create a `config.json` file in your project that looks something like the following. **Tip:** You can run `data-spring config <config-file>` to generate a boilerplate config file.

The config file is how you define the shape of your dataset (i.e. creating fields and possible values for them).

```json
const config = [
  { "id": "rec_id", "type": "id" },
  {
    "id": "date",
    "type": "date",
    "interval": {
      "type": "month",
      "recordsPerInterval": 2,
    },
    "min": "2020-01-01 00:00:00",
    "max": "2020-12-01 00:00:00",
  },
  {
    "id": "department",
    "type": "string",
    "values": ["Transportation", "Environment", "Health", "Parks"],
  },
  {
    "id": "budget",
    "type": "number",
    "min": 10000,
    "max": 100000,
  },
];
```

Next, run the cli using your config file, passing the path to your config file as well as the path to where you want the data to be output.

```shell
data-spring <config-file> <output-file>
```

That's it! Open up the output file and you should see your generated dataset.

### CLI Commands

1. create
2. config

#### `create`

```shell
data-spring create <config-file> <output-file>
```

| Argument    | Description                  |
| ----------- | ---------------------------- |
| config-file | Path to the JSON config file |
| output-file | Path to the JSON output file |

#### `config`

```shell
data-spring config <output-file>
```

| Argument    | Description                             |
| ----------- | --------------------------------------- |
| output-file | Path for the generated config JSON file |

#### Examples

- Create a new dataset based on a config file in your current working directory. Output a the dataset in the same directory.

```shell
data-spring create config.json output.json
```

#### `config`

- Create a new config file based off of the starting template called `config.json` in the current working directory.

```shell
data-spring config config.json
```

---
_Source: https://npm.io/package/data-spring-cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
