0.0.2 • Published 8 years ago

orcid-search-url-js v0.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

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

  1. Install

    npm install orcid-search-url-js

  2. Require the module

    var orcidSearchUrl = require('orcid-search-url-js');

  3. 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.