parse-key-value

1.0.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i parse-key-value

Weekly Downloads

489

Version

1.0.0

License

LGPL-3.0

Last publish

Collaborators

  • stefanhamminga