1.0.0 • Published 4 years ago
yfpl v1.0.0
YFPL
YFPL = Your Friendly Programming Language
Example
foo - "bar"
bar - falseSeparate the name and value by -
Important Note: It's important to add spaces in-between - otherwise the parser won't be able to read your data!
Parsing YFPL to JS Object
const YFPL = require('yfpl');
YFPL.parse('some - "data"');Or read from a file:
const fs = require('node:fs');
// or require('fs');
const YFPL = require('yfpl');
const data = fs.readFileSync('/path/to/file');
const res = YFPL.parse(data);
console.log(res);Convert JS Object to valid YFPL data using stringify
const YFPL = require('yfpl');
const dataObj = YFPL.stringify({
some: 'data',
right: true,
});
console.log(dataObj);Should output:
some - "data"
right - trueData Types
Data types can be:
string
number
boolean
null|undefined
Example of All Data Types
str - "string"
num - 10111
bool - true
bool2 - false
nothing - null
again_nothing - undefined1.0.0
4 years ago