Skip to content

Load partial values from multiple sources, such as other files.

License

Notifications You must be signed in to change notification settings

jsonicjs/multisource

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

multisource

Load partial values from multiple sources, such as other files.

npm version build Coverage Status Known Vulnerabilities DeepScan grade Maintainability

Voxgig This open source module is sponsored and supported by Voxgig.

Basic Example

# file: foo.jsonic
a:1
import { Jsonic } from '@jsonic/jsonic-next'
import { MultiSource } from '@jsonic/multisource'
import { makeFileResolver } from '@jsonic/multisource/resolver/file'

let j = Jsonic.make().use(MultiSource, {
  resolver: makeFileResolver(),
})

const out = j('@"foo.jsonic" b:2')
// out === { a:1, b:2 }

Options

  • implictExt
    • 0: string (default: jsonic) - 0
    • 1: string (default: jsc) - 1
    • 2: string (default: json) - 2
    • 3: string (default: js) - 3
  • markchar: string (default: @) - markchar
  • processor
    • __: function (default: (res) => (res.val = process(res.src, res))) -
    • js: instance (required) - js
    • jsc: instance (required) - jsc
    • json: function (default: (res) => (res.val = process(res.src, res))) - json
    • jsonic: instance (required) - jsonic

About

Load partial values from multiple sources, such as other files.

Resources

License

Stars

Watchers

Forks

Packages

No packages published