1.0.4 • Published 2 years ago

url-template-param-parser v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

URL Parameter Parser

A TypeScript library for parsing parameters in a URL template string.

Installation

npm i url-template-param-parser --save

Usage

import parseURLParams from 'url-template-param-parser';

const url = 'https://test.com:8080/user/:user_id/comment/:comment_id';
const result = parseURLParams(url);
console.log(result); // ['user_id', 'comment_id']

Example

import parseURLParams from 'url-template-param-parser';

const template = '/user/:user_id/comment/:comment_id';
const result = parseURLParams(template);
console.log(result); // ['user_id', 'comment_id']

License

This library is licensed under the MIT License.

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago