@dougrich/data-storage

0.2.0 • Public • Published

Efficient Linked Data Storage

Getting Started

Assuming that you have a file called abc.yml next to your script, containing:

title: this is a test
subtitle: this is really a subtitle
description:
- $ref: '#/title'
- $ref: '#/subtitle'
// verbose
const { ResourceEngine, StandardParsers, FileResolver } = require('@dougrich/data-storage')
const engine = new Resourceengine(StandardParsers, new FileResolver(__dirname))
const node = await engine.get('file:///abc.yml')

// file standard
const { FileEngine } = require('@dougrich/data-storage)
const engine = new FileEngine(__dirname)
const node = await engine.get('file:///abc.yml')

In both cases, the resulting node will look like this:

{
  "title": "this is a test",
  "subtitle": "this is really a subtitle",
  "description": [
    "this is a test",
    "this is really a subtitle"
  ]
}

References can be across files as well.

Examples

See ./examples for detailed examples. Each example includes a index.js that includes the same client code.

Readme

Keywords

none

Package Sidebar

Install

npm i @dougrich/data-storage

Weekly Downloads

2

Version

0.2.0

License

MIT

Unpacked Size

7.4 kB

Total Files

11

Last publish

Collaborators

  • dougrich