1.0.0 • Published 8 years ago

parse-key-value v1.0.0

Weekly downloads
506
License
LGPL-3.0
Repository
github
Last release
8 years ago

parse-key-value

JavaScript parser for key1=value1;"key 2"="value 2"; strings.

Installation

npm install --save parse-key-value

Usage

const string = "id=myId;description='My test string';weight=0.5;bool=true";

const parse = require('parse-key-value');

// either create a new object:
const object = parse(string);

// or extend an existing one:
const object = {};
parse(string, object);

should result in:

const object = {
    id: "myId",
    description: "My test string",
    weigth: 0.5,
    bool: true
};

Notes & license

This project is available on GitHub and npm.

The project is licensed as LGPLv3, the license file is included in the project directory.

Copyright 2016 Stefan Hamminga - prjct.net