orcid-search-url-js
v0.0.2
Published
A node module for constructing the URL to do a search across the ORCID public API
Downloads
4
Readme
orcidSearchUrl.js
Javascript library that builds a search URL for the ORCID public API.
Functions
- buildUrl(input) Takes a JSON object defining the search, and returns the URL to use in the API.
The input JSON object can have the following properties.
See orcidSearchUrlSpec.js for examples.
setBaseUrl(url) Sets the base URL to use. The default is 'https://orcid.org/v1.1/search/orcid-bio/'.
isValidInput(input) Returns true only if there is some input to search with.
isValidOrcidId(orcidId) Returns true only if orcidId contains a valid looking ORCID iD URI or path. Allows preceding and trailing whitespace.
Using in a browser
Include orcidSearchUrl.js and call orcidSearchUrlJs.buildUrl({ text: 'my search terms'})
.
Using in Node.js
Install
npm install orcid-search-url-js
Require the module
var orcidSearchUrl = require('orcid-search-url-js');
Call
orcidSearchUrlJs.buildUrl({ text: 'my search terms'});
Contributing
Contributions are welcome.
Please make sure the unit tests (orcidSearchUrlSpec.js) reflect the changes and complete successfully.