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

@resistdesign/cjs

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@resistdesign/cjs

A JavaScript Database Collection Manager with Context Driven Typing and Relationship Mapping.

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Collection JS

A JavaScript Database Collection Manager with Context Driven Typing and Relationship Mapping.

Installation

Run npm i -S @resistdesign/cjs

Usage

import Collection from '@resistdesign/cjs';

async function createTodo() {
  const todoContext = {
    title: String,
    description: String,
    createdOn: Date
  };
  // Cyclical, nested items.
  todoContext.childTodos = [todoContext];
  const todos = await Collection.getCollectionStructure({
    name: 'Todos',
    db: 'mongodb://localhost:27017/example-db',
    context: todoContext,
    deleteNested: {
      childTodos: true
    }
  });
  const createdOn = new Date();

  return await todos.create([
    {
      title: 'Wash Clothes',
      description: `Get them very clean, you're going to need to look your best! :)`,
      createdOn
    },
    {
      title: 'Jump Rope',
      description: 'Time to stay in shape!',
      createdOn,
      childTodos: [
        {
          title: 'Learn Tricks',
          description: `You'd look silly just hopping up and down like that without a little pizzazz.`,
          createdOn
        }
      ]
    }
  ]);
}

createTodo();

API

View the API documentation here.

License

MIT

Keywords

FAQs

Package last updated on 27 May 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