Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/juliendargelos/parameters-js
Simply manage url parameters.
https://github.com/juliendargelos/parameters-js
Last synced: 4 days ago
JSON representation
Simply manage url parameters.
- Host: GitHub
- URL: https://github.com/juliendargelos/parameters-js
- Owner: juliendargelos
- Created: 2017-12-01T18:32:48.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-05-30T08:02:03.000Z (over 6 years ago)
- Last Synced: 2024-11-11T05:38:34.878Z (2 months ago)
- Language: JavaScript
- Size: 55.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.hbs
Awesome Lists containing this project
README
# Parameters JS 🔑
[![npm version](https://badge.fury.io/js/parameters-js.svg)](https://badge.fury.io/js/parameters-js)
[![Maintainability](https://api.codeclimate.com/v1/badges/ef4ed91e5826a0767fae/maintainability)](https://codeclimate.com/github/juliendargelos/parameters-js/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/ef4ed91e5826a0767fae/test_coverage)](https://codeclimate.com/github/juliendargelos/parameters-js/test_coverage)Simply manage url parameters.
## Install
```
npm install parameters-js
```## Usage
```javascript
var Parameters = require('parameters-js');var parameters = new Parameters();
parameters.post = 2;
parameters.string;
// => "post=2"parameters.date = '10/12/1997';
parameters.string;
// => "post=2&date=10%2F12%2F1997"parameters.authors = [
{name: 'Marie', country: 'England'},
{name: 'Marc', country: 'France'}
];
parameters.string;
// => "post=2&date=10%2F12%2F1997&authors[][name]=Marie&authors[][country]=England&authors[][name]=Marc&authors[][country]=France"var otherParameters = new Parameters();
otherParameters.string = "post=2&date=10%2F12%2F1997&authors[][name]=Marie&authors[][country]=England&authors[][name]=Marc&authors[][country]=France";
otherParameters;
// => Parameters {
// post: '2',
// date: '10/12/1997',
// authors: [
// {name: 'Marie', country: 'England'},
// {name: 'Marc', country: 'France'}
// ]
// }
```{{>main}}