Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

ashtin

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ashtin

ArchivesSpace Hacker's Toolkit (in Node).

latest
Source
npmnpm
Version
0.0.4
Version published
Maintainers
1
Created
Source

ArchivesSpace Hacker's Toolkit (in Node)

This is a work in progress. It includes a command-line interface and repl for working with the ArchivesSpace backend API, and can also be used to build custom scripts or client applications in NodeJS.

Global Install

To install:

$ npm install ashtin -g

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

$ ashtin setup

Create a repository:

$ ashtin repositories create --repo-code FOO --name BAR

View repository list and select your active repository:

$ ashtin repositories

See the available subcommands:

$ ashtin

Local Install

In addition to the built-in commands, you can use this package for custom scripts or applications. For example, if you'd like to write a simple node app that creates one random resource record in your default repository, and assuming you've installed the global utility per the section above:

$ ashtin setup
$ npm init
$ npm install ashtin --save
$ touch create-repo.js

This would be the body of your create-repo.js file:

#!/usr/bin/env node

module.exports = function(api, generator) {

  if (!api.hasSession) {
    console.log("Please get logged in first");
    throw("Not logged in");
  }

  api.createResource(generator.resource()).
    then(function(json) {
    console.log("Created: " + json.uri);
  }).
  catch(function(err) {
    console.log(":( " + err);
  });
};

And you would run it like this:

ashtin run-script create-repo.js

Your script must to export a single function with 'injected' arguments. There are currently two available arguments for injection:

  • 'api' - an AS client
  • 'generator' - some simple record generators

You can also add a module to this toolkit by writing your own library in the lib directory and submitting a pull request.

Additional example scripts are in the 'examples' directory.

Keywords

archivesspace

FAQs

Package last updated on 02 Dec 2015

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