npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

dspace7-node

v1.0.9

Published

DSpace 7 Node Client

Downloads

173

Readme

DSpace Node

main NPM version NPM downloads

NodeJs client for DSpace 7 REST API

Installation

npm install dspace7-node

or

yarn add dspace7-node

Example Usage

Example of some of the operations currently supported:

import * as DSpace from 'dspace7-node'

(async () => {
  const baseUrl = '' // e.g., https://demo.dspace.org/server
  const user = ''
  const password = ''

  // Init and login
  DSpace.init(baseUrl)
  await DSpace.login(user, password)

  // Show list of top communities and its collections
  await DSpace.showCollections()

  // Add/delete collections
  const parentCommunityId = '5c1d0962-2a01-4563-9626-d14c964ca3ad'
  await DSpace.createCollection(parentCommunityId, 'Test Collection 2')
  const collectionId = 'e30cdb05-1909-4365-ab28-68d4534b174a'
  await DSpace.deleteCollection(collectionId)

  // Move item to another collection (change 'owningCollection')
  const itemId = '6641e0c5-10c7-4251-ba31-1d23f1bd2813'
  const targetCollection = 'dcbde2c8-b438-46e9-82ba-9e9e674aa3c5'
  await DSpace.moveItem(itemId, targetCollection)

  // Update item with any payload (from v1.0.9)
  await DSpace.updateItem(itemId, [
    {
      op: 'add',
      path: '/metadata/dspace.entity.type',
      value: [{ value: 'Publication' }]
    }
  ])

  // Get bundle details
  await DSpace.showItemBundles(itemId)
  await DSpace.showItemBundles(itemId, 'ORIGINAL')

  // Add/delete bitstreams
  const bitstreamId = '4478411f-b01f-490c-a16a-59e9c9c558d9'
  await DSpace.newBitstream(itemId, 'Test Item 1.pdf', 'C:/temp/files')
  await DSpace.deleteBitstreams(bitstreamId)
  await DSpace.deleteBitstreamsByItemId(itemId)  // in all bundles, except 'LICENSE'
})()

Motivation and Use Cases

The motivation to write with example use cases are described here: Batch operations using DSpace 7 REST API

Features

  • Show communities/subcommunities/collections
  • Show items/bundles/bitstreams
  • Add/delete communities/collections
  • Move items between collections
  • Add/delete bitstreams

Tests

TO DO