Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (imd.js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
โก Imd.js
A elegant JavaScript alternative for in-memory documents
Imd.js (In Memory Documents) is a powerful alternative library for saving data in memory.
๐ ] Features
- Remote sync;
- Fast and elegant;
- Easy integration and ready to use;
- Key or auto increased number in Document Identifiers;
๐บ ] Links
- Package:
- Contributors:
๐ ] 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')
// => trueMade with ๐ by Amรฉlia R.