🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

as-cli

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

as-cli

Command line tool suite for ArchivesSpace

Source
npmnpm
Version
0.0.1
Version published
Weekly downloads
3
-76.92%
Maintainers
1
Weekly downloads
 
Created
Source

ArchivesSpace CLI

NodeJS command line client for ArchivesSpace. Work in progress.

Getting Started

Install:

$ npm install as-cli

Log in to your ArchivesSpace instance and save your session key:

$ as-cli setup

Select your active repository:

$ as-cli repositories

Usage

To see all available subcommands:

$ as-cli

Using Custom Scripts

In addition to the built-in commands, you can use a custom script. Your script should assign a single function to the module.exports global object, and that function should take a single argument, which is the activated client.

See https://github.com/lcdhoffman/asapi for more information about working with the api.

$ as-cli run-script path/to/your/script.js

Example script:

module.exports = function(api) {
  api.eachResource(function(resource) {
    var update = false;

    for (var i = 0; i < resource.extents.length; i++) {

      if (resource.extents[i] && resource.extents[i].extent_type == 'linear_feet') {
        resource.extents[i].number = (resource.extents[i].number * 0.3048) + "";
        resource.extents[i].extent_type = "linear_meters";
        update = true;
      }
    }

    if (update) api.updateRecord(resource, function(err, body) {
      if (err) {
        throw (err).
      } else {
        console.log(body);
      }
    });
  })
});

Keywords

archivesspace

FAQs

Package last updated on 04 Aug 2014

Did you know?

Socket

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.

Install

Related posts