yek

Generates a key path from arrays and back again.

Usage no npm install needed!

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

README

yek

Greenkeeper badge

Yek is key spelt backwards. It changes ["one", "two", "three"] to one[two][three] and back. It is a simple library and does stresses on consistency to and fro. It's a bracket notation and is not customizable to be dot notation.

Build Status Coverage Status npm version bitHound Score

Example use cases

var atos = require('yek/atos');
atos(['one', 'two', 'three']);
// returns one[two][three]

var stoa = require('yek/stoa');
stoa('one[two][three]');
// returns ['one', 'two', 'three']

Usage

Install from npm.

npm install --save yek

Changing Array to String (atos)

var atos = require('yek/atos');
atos(['one', 'two', 'three']);
// returns one[two][three]

Changing String to Array (stoa)

var stoa = require('yek/stoa');
stoa('one[two][three]');
// returns ['one', 'two', 'three']

License

MIT