The rev-strings
package is a library to facilitate string composition and interpretation.
- includes common regex patterns (phone, zip, etc)
- quickly compose query strings on the fly
$ npm install rev-strings
Suppose we have a UI that needs to append an object as a query string.
import { rStrings } from 'rev-strings';
const query = { userId: 12 };
const result = rStrings.toQueryString(query);
// result = "?userId=12"