With curiejs
you can handle curie links provided by hypermedia (e.g. HATEOAS) APIs.
You can install curiejs
with npm
:
npm install curiejs --save
You can use curiejs
in your javascript
projects:
import Curie from 'curiejs'
// Hypermedia link as provided by hypermedia api (e.g. spring-data-rest)
const link = "http://localhost:4000/api/entity{?page,size,projection}";
// Parameters
const params = { page: 1, projection: 'detail' };
new Curie(link).toUri();
// --> 'http://localhost:4000/api/entity'
new Curie(link, params).toUri();
// --> 'http://localhost:4000/api/entity?page=1&projection=detail'
Relased under the MIT licence by Sebastian Ullrich (deepsource.de).