Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rethinkdb-fixtures

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rethinkdb-fixtures

Easily load fixtures into Rethinkdb. Useful for testing.

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
14
increased by250%
Maintainers
1
Weekly downloads
 
Created
Source

rethinkdb-fixtures

Easily load fixtures into Rethinkdb. Useful for testing.

Insert

const Insert = require('rethinkdb-fixtures').Insert;

const options = {
    db: 'test'
};

const fixture = {
        items: [
            {
                name: 'Bike'
            },
            {
                name: 'Wrench'
            }
        ],
        people: [
            {
                name: 'Wild Man Fischer'
            },
            {
                name: 'Charles Ponzi'
            }
        ]
    }
};

Insert(options,fixture).then( (createdObjects) => {

    console.log(createdObjects.items, createdObjects.people);
}, console.error);

Delete

const Delete = require('rethinkdb-fixtures').Delete;
Delete(options, ['items', 'people']).then( (result) => {

    console.log(result); // standard rethinkdb change objects
},console.error);

To test:

make sure you have an instance of rethinkdb running somewhere

npm test

Command line usage

To insert:
export RETHINKDB=test
export FIXTURE=./fixtures.json
node ./bin/insert.js
To delete tables
export RETHINKDB=test
export TABLES='table1,table2,table3'
node ./bin/delete.js

Keywords

FAQs

Package last updated on 02 Feb 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc