Security News
npm Updates Search Experience with New Objective Sorting Options
npm has a revamped search experience with new, more transparent sorting options—Relevance, Downloads, Dependents, and Publish Date.
@cumulus/cmr-client
Advanced tools
[![Build Status](https://travis-ci.org/nasa/cumulus.svg?branch=master)](https://travis-ci.org/nasa/cumulus)
A Node.js client to read from, write to, and delete from NASA's Common Metadata Repository (CMR) API.
A class to simplify requests to the CMR
A class to efficiently list all of the concepts (collections/granules) from CMR search, without loading them all into memory at once. Handles paging.
A class to simplify requests to the CMR
Kind: global class
Promise.<string>
Object
Promise.<Object>
Promise.<Object>
Promise.<Object>
Promise.<Object>
Promise.<Object>
Promise.<Object>
Promise.<Object>
The constructor for the CMR class
Param | Type | Description |
---|---|---|
params | Object | |
params.provider | string | the CMR provider id |
params.clientId | string | the CMR clientId |
params.username | string | CMR username |
params.password | string | CMR password |
Example
const { CMR } = require('@cumulus/cmr-client');
const cmrClient = new CMR({
provider: 'my-provider',
clientId: 'my-clientId',
username: 'my-username',
password: 'my-password'
});
Promise.<string>
The method for getting the token
Kind: instance method of CMR
Returns: Promise.<string>
- the token
Object
Return object containing CMR request headers
Kind: instance method of CMR
Returns: Object
- CMR headers object
Param | Type | Description |
---|---|---|
params | Object | |
[params.token] | string | CMR request token |
[params.ummgVersion] | string | UMMG metadata version string or null if echo10 metadata |
Promise.<Object>
Adds a collection record to the CMR
Kind: instance method of CMR
Returns: Promise.<Object>
- the CMR response
Param | Type | Description |
---|---|---|
xml | string | the collection XML document |
Promise.<Object>
Adds a granule record to the CMR
Kind: instance method of CMR
Returns: Promise.<Object>
- the CMR response
Param | Type | Description |
---|---|---|
xml | string | the granule XML document |
Promise.<Object>
Adds/Updates UMMG json metadata in the CMR
Kind: instance method of CMR
Returns: Promise.<Object>
- to the CMR response object.
Param | Type | Description |
---|---|---|
ummgMetadata | Object | UMMG metadata object |
Promise.<Object>
Deletes a collection record from the CMR
Kind: instance method of CMR
Returns: Promise.<Object>
- the CMR response
Param | Type | Description |
---|---|---|
datasetID | string | the collection unique id |
Promise.<Object>
Deletes a granule record from the CMR
Kind: instance method of CMR
Returns: Promise.<Object>
- the CMR response
Param | Type | Description |
---|---|---|
granuleUR | string | the granule unique id |
Promise.<Object>
Search in collections
Kind: instance method of CMR
Returns: Promise.<Object>
- the CMR response
Param | Type | Default | Description |
---|---|---|---|
params | string | the search parameters | |
[format] | string | "json" | format of the response |
Promise.<Object>
Search in granules
Kind: instance method of CMR
Returns: Promise.<Object>
- the CMR response
Param | Type | Default | Description |
---|---|---|---|
params | string | the search parameters | |
[format] | string | "'json'" | format of the response |
A class to efficiently list all of the concepts (collections/granules) from CMR search, without loading them all into memory at once. Handles paging.
Kind: global class
Promise.<Object>
Promise.<Object>
The constructor for the CMRSearchConceptQueue class
Param | Type | Default | Description |
---|---|---|---|
params | Object | ||
params.provider | string | the CMR provider id | |
params.clientId | string | the CMR clientId | |
params.type | string | the type of search 'granule' or 'collection' | |
[params.searchParams] | string | "{}" | the search parameters |
params.format | string | the result format |
Example
const { CMRSearchConceptQueue } = require('@cumulus/cmr-client');
const cmrSearchConceptQueue = new CMRSearchConceptQueue({
provider: 'my-provider',
clientId: 'my-clientId',
type: 'granule',
searchParams: {},
format: 'json'
});
Promise.<Object>
View the next item in the queue
This does not remove the object from the queue. When there are no more items in the queue, returns 'null'.
Kind: instance method of CMRSearchConceptQueue
Returns: Promise.<Object>
- an item from the CMR search
Promise.<Object>
Remove the next item from the queue
When there are no more items in the queue, returns null
.
Kind: instance method of CMRSearchConceptQueue
Returns: Promise.<Object>
- an item from the CMR search
CMR REST API endpoint documentation is here:
Cumulus is a cloud-based data ingest, archive, distribution and management prototype for NASA's future Earth science data streams.
Test with npm run test
.
See Cumulus README
Generated automatically using npm run build-docs
FAQs
A Node.js client to NASA's Common Metadata Repository (CMR) API.
We found that @cumulus/cmr-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm has a revamped search experience with new, more transparent sorting options—Relevance, Downloads, Dependents, and Publish Date.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.