1.0.4 • Published 12 months ago

url-template-param-parser v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months 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

12 months ago

1.0.3

12 months ago

1.0.2

12 months ago

1.0.1

12 months ago

1.0.0

12 months ago