# cufflink

> A command tool to help generate seed data based on your object schema in your applications

Latest version **1.3.0** (published 2017-01-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install cufflink
pnpm add cufflink
yarn add cufflink
bun add cufflink
```

Provides the command `cufflink`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2017-01-09 |
| First published | 2016-10-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=5.0.0 |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Gentux |
| Maintainers | gentux |
| Keywords | gentux, database, seeder, object, schema, fixture, generation, tux, seed, table |

## Links

- npm: https://www.npmjs.com/package/cufflink
- Repository: https://github.com/generationtux/cufflink
- Homepage: https://github.com/generationtux/cufflink#readme
- Issues: https://github.com/generationtux/cufflink/issues
- npm.io page: https://npm.io/package/cufflink

## Dependencies (3)

- [ora](https://npm.io/package/ora.md) ^0.3.0
- [commander](https://npm.io/package/commander.md) ^2.9.0
- [dependency-graph](https://npm.io/package/dependency-graph.md) ^0.5.0

## Alternatives

- [@lexical/table](https://npm.io/package/@lexical/table.md) — 3.0M weekly downloads
- [mantine-datatable](https://npm.io/package/mantine-datatable.md) — 98.2K weekly downloads
- [react-native-collapsible-tab-view](https://npm.io/package/react-native-collapsible-tab-view.md) — 70.6K weekly downloads
- [@handsontable/vue3](https://npm.io/package/@handsontable/vue3.md) — 16.1K weekly downloads
- [vuewordcloud](https://npm.io/package/vuewordcloud.md) — 7.2K weekly downloads

## Recent versions

- 1.3.0 (latest) — 2017-01-09
- 1.2.2 — 2016-11-15
- 1.2.0 — 2016-11-15
- 1.1.1 — 2016-11-14
- 1.0.0 — 2016-11-14
- 0.0.35 — 2016-11-09
- 0.0.34 — 2016-10-21
- 0.0.31 — 2016-10-20
- 0.0.29 — 2016-10-20
- 0.0.28 — 2016-10-19
- 0.0.27 — 2016-10-19
- 0.0.26 — 2016-10-19
- 0.0.25 — 2016-10-19
- 0.0.24 — 2016-10-19
- 0.0.23 — 2016-10-17
- … 4 more at https://npm.io/package/cufflink/versions

## README

# cufflink
A command tool to help generate seed data based on your object schema in your applications

[![Build Status](https://travis-ci.org/generationtux/cufflink.svg?branch=master)](https://travis-ci.org/generationtux/cufflink)
[![Coverage Status](https://coveralls.io/repos/github/generationtux/cufflink/badge.svg?branch=master)](https://coveralls.io/github/generationtux/cufflink?branch=master)

Cufflink is a simple npm package to help seed data for API tests. Cufflink will seed your databases and create a json file with the results for a consistent way to test your API.

1. Describe your data scheme and dependencies through objects
3. Add drivers for those objects
4. Run following command

```
$ cufflink create your-object
$ cufflink teardown [optional seeded file path]
```

Highlights
-------

* Simple CLI
* Determines what order to seed database depending on dependencies
* Fully documented
* Fully unit tested
* Framework-agnostic

System Requirements
-------

You need **Node >= 5.0.0**

Installation
-------

```
$ npm install cufflink
```

Configuration
-------

In order to use Cufflink, your directory structure must follow the specified structure:

```
root_directory/
    objects/
    drivers/
```

The `objects` directory will contain the schemas for your objects

Ex:
```
    {
        "type": "customer",
        "properties": {
            "fields": [
                {
                    "name": "id",
                    "type": "int"
                },
                {
                    "name": "customerId",
                    "type": "int"
                }
            ]
            "dependencies": [
                "customer"
            ]
        }
    }
```

The `drivers` directory will contain the drivers to persist your objects to your databases.
Driver's names should be the same as the associated object

Ex: The `cart` object above should have a corresponding `cart` driver that resides in the `drivers` directory

Using the API
-------------

Use the Cufflink API directly in your programs like this:

```
let cufflink = require('cufflink/api');

cufflink.create('measurement').then((result) => {
    cufflink.tearDown(result);
});
```

Cufflink also has a `createSync` feature that doesn't use Promises.

```
let objects = cufflink.createSync('measurement');
```

Testing
-------

```
$ npm test
```

Contributing
-------

Contributions are welcome and will be fully credited. Please see [CONTRIBUTING](.github/CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

Security
-------

If you discover any security related issues, please email admin@generationtux.com instead of using the issue tracker.

Credits
-------

- [All Contributors](https://github.com/generationtux/cufflink/graphs/contributors)

License
-------

The MIT License (MIT). Please see [LICENSE](LICENSE) for more information.

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