wresolverextra

Collection of cross-platform routines to resolve complex data structures. It takes a complex data structure, traverses it and resolves all strings having inlined special substrings. Use the module to resolve your templates.

Usage no npm install needed!

<script type="module">
  import wresolverextra from 'https://cdn.skypack.dev/wresolverextra';
</script>

README

module::ResolverExtra status experimental

Collection of cross-platform routines to resolve complex data structures. It takes a complex data structure, traverses it and resolves all strings having inlined special substrings. Use the module to resolve your templates.

Try out from the repository

git clone https://github.com/Wandalen/wResolverExtra
cd wResolverExtra
will .npm.install
node sample/trivial/Sample.s

Make sure you have utility willbe installed. To install willbe: npm i -g willbe@stable. Willbe is required to build of the module.

To add to your project

npm add 'wresolverextra@stable'

Willbe is not required to use the module in your project as submodule.

Sample


let _ = require( 'wresolverextra' );

var src =
{
  dir :
  {
    val1 : 'Hello'
  },
  val2 : 'here',
}

let resolved = _.resolverAdv.resolve( src, '{::dir/val1} from {::val2}!' );
console.log( resolved );

/*
log : `Hello from here!`
*/