Skip to content

JavaScript/Typescript util for querying dynamic/named params

License

Notifications You must be signed in to change notification settings

spinualexandru/query-dynamic-params

Repository files navigation

query-dynamic-params Build

JavaScript/Typescript util for querying dynamic/named params

Installation

npm install query-dynamic-params

Usage

import { queryDynamicParams } from 'query-dynamic-params';

const url = '/users/:id/:name';
const path = '/users/1/john';

const params = queryDynamicParams(url, path, ['id', 'name']);
console.log(params); // { id: '1', name: 'john' }

Build

npm run build

Test

npm run test

License

MIT

About

JavaScript/Typescript util for querying dynamic/named params

Resources

License

Stars

Watchers

Forks

Packages

No packages published