@tabnas/multisource
v0.2.0
Published
Load partial values from multiple sources (files, packages, memory) into a single [Tabnas](https://github.com/tabnas/jsonic) parse result. A marked path (`@a.jsonic`) is resolved, parsed, and spliced in place.
Readme
multisource
Load partial values from multiple sources (files, packages, memory) into a
single Tabnas parse result. A marked path
(@a.jsonic) is resolved, parsed, and spliced in place.
|
| This open source module is sponsored and supported by Voxgig. |
| ---------------------------------------------------- | --------------------------------------------------------------------------------------- |
Install
npm install @tabnas/multisource @tabnas/parser @tabnas/jsonicTiny example
import { Tabnas } from '@tabnas/parser'
import { jsonic } from '@tabnas/jsonic'
import { MultiSource } from '@tabnas/multisource'
import { makeMemResolver } from '@tabnas/multisource/resolver/mem'
const j = new Tabnas().use(jsonic).use(MultiSource, {
resolver: makeMemResolver({ 'foo.jsonic': 'a:1' }),
})
j.parse('@"foo.jsonic" b:2') // => { a: 1, b: 2 }Documentation
Four-quadrant Diátaxis docs:
- Tutorial — zero to a working multisource parse.
- How-to guide — recipes: files, custom kinds, merging, base paths, dependency tracking, preloading.
- Reference — every export, option and type.
- Concepts — how it works and why; the engine relationship.
The Go port lives in ../go with its own
four-quadrant docs.
Grammar diagram
The installed grammar as a railroad/syntax diagram, generated from the live
grammar with @tabnas/railroad:
A vertical ASCII version is in doc/grammar.txt.
License
MIT © Richard Rodger and contributors.
