Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

zenodo_upload

  • zenodo_upload(deposition_id: number, file: string, version: string, access_token: string, options?: Options): Promise<PublishResult>
  • Create a new version of a Zenodo upload with a file.

    Makes a draft copy of an existing Zenodo upload. After overwriting the file and version the upload is published.

    For example

    import fs from 'fs';
    import zenodo_upload from '@iomeg/zenodo-upload';
    
    const deposition_id = 1234567;
    const filename = 'somefile.txt';
    await fs.promises.writeFile(filename, 'sometext', 'utf8');
    const version = '1.2.3';
    const access_token = 'sometoken';
    
    const result = await zenodo_upload(deposition_id, filename, version, access_token);
    console.log(`New zenodo entry ${result.doi} created`);
    
    throws

    {DraftDiscardedError} When options.checksum and file is already present.

    Parameters

    • deposition_id: number

      Zenodo upload identifier

    • file: string

      Path to file to upload

    • version: string

      Version to use

    • access_token: string

      The Zenodo personal access token with the deposit:actions and deposit:write scopes.

    • options: Options = ...

      Advanced options

    Returns Promise<PublishResult>

    The id, url of the html page and the DOI of the new version.

Generated using TypeDoc