1.3.1 • Published 5 months ago

imd.js v1.3.1

Weekly downloads
-
License
LGPL-3.0-only
Repository
github
Last release
5 months ago

Imd.js (In Memory Documents) is a powerful alternative library for saving data in memory.

🚀 Package

📚 ] Features

  • Remote sync;
  • Fast and elegant;
  • Easy integration and ready to use;
  • Key or auto increased number in Document Identifiers;

🔺 ] Links

📗 ] Quick Starting

This quick start guide shows you how to use the basic functions of the library in local use, for integrated server use cases visit the documentation...

Import, first we need to import the library

const Imdjs = require('imd.js')

Now, we need to instantiate before we do any operations

const MyDocuments = new Imdjs.default()

After we import and instantiate, here are examples of creating documents and getting them.

  • create(value, key?, timestamp?): Used to create a new document
const MyTextDocument = MyDocuments.create('Hello World!')
// => Document { _id: 1, content: "Hello World!", timestamp: "..." }
  • EXPERIMENTAL bulkCreate(value, key?): Used to create multiple documents in one time
MyDocuments.bulkCreate([
    {
        content: 'Hello World',
    },
    {
        key: 'hello-world-in-portuguese',
        content: 'Olá mundo',
    },
])
// => [
//      Document { _id: 1, content: "Hello World!", timestamp: "..." },
//      Document { _id: "hello-world-in-portuguese", content: "Olá mundo!", timestamp: "..." },
//   ]
  • rescue(identificator): Used to obtain a document
const MyTextDocument = MyDocuments.create('Hello World!')

MyDocuments.rescue(MyTextDocument._id)
// => Document { _id: 1, content: "Hello World!", timestamp: "..." }
  • remove(identificator): Used to delete a document
MyDocuments.remove('document-id')
// => true

1.3.1

5 months ago

1.3.0

5 months ago

1.2.0

5 months ago

1.1.0

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago