zenodo
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

zenodo

Node.js library to access the Zenodo API

Zenodo API Documentation

https://developers.zenodo.org/

Testing the project

In order to test the project you will have to create a .env file that contains an API key to the sandbox.

https://developers.zenodo.org/#authentication

Usage

// by default we set the host to 'sandbox.zenodo.org' so that you can easily play around with this library without damage
const zenodo = new Zenodo({ accessToken, host: 'zenodo.org' });

// retrieve the list of all the depositions
const depositions = await zenodo.listDepositions();
for (const deposition of depoositions) {
  console.log(deposition);
}

// create a new deposition
const deposition = zenodo.createDeposition({
  upload_type: 'dataset',
  description: 'test',
  access_right: 'open',
  creators: [
    {
      name: 'test',
    },
  ],
});
const firstDeposition = await zenodo.createDeposition(depositionMetadata);

const firstFile = new File(['Hello, world!'], 'example.txt', {
  type: 'text/plain',
});
const newFile = await firstDeposition.createFile(firstFile);

const secondFile = new File(['Hello, world 2!'], 'example2.txt', {
  type: 'text/plain',
});

Development

Readme

Keywords

none

Package Sidebar

Install

npm i zenodo

Weekly Downloads

5

Version

2.0.0

License

MIT

Unpacked Size

165 kB

Total Files

77

Last publish

Collaborators

  • targos
  • lpatiny
  • cheminfo-bot
  • stropitek