Socket
Socket
Sign inDemoInstall

caki

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    caki

A persitent data reader


Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Caki

Caki is a library that provides a simple interface that reads handwritten config files.

Quickstart

  • Comments begin with a #
  • Comments are ignored
  • Empty spaces are ignored
  • Empty lines are ignored
  • Identifiers (keys) are [_a-zA-Z0-9]+
  • You can use integers and floats

Comments begin with a '#', eg.:

# This is a comment

Each node is a pair of a key and a value, like:

<key> <value>;

You can declare subnodes too:

<key> {
	<key> <value>;
	<key> <value>;
	.
	.
	.
}

You must put a semicollon (;) at the end of line.

Example file:


# This is an example file

name "George Lucas";

login {
	username "root";
	password "123456";
}

pi 3.14159;
bits 32;

Then you can import and parse it:

const caki = require('caki');
const fs = require('fs');

const fileContent = fs.readFileSync('example.txt');
const example = caki.parse(fileContent);
console.log(JSON.stringify(example, undefined, 2));

LICENSE

MIT

Keywords

FAQs

Last updated on 22 Jul 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc