0.0.3 • Published 5 years ago

@qri-io/qri-node v0.0.3

Weekly downloads
1
License
GPLV3
Repository
-
Last release
5 years ago

qri-node

A nascent nodejs wrapper for Qri CLI.

Usage

You should have qri CLI already installed. You should have also run qri setup to create a username and a local qri repo.

All methods take a flags argument as an object which will be converted into CLI flags. Use qri [command] --help for a list of flags.

const qri = require('@qri-io/qri-node')

// save a dataset version
qri.save('me/some-cool-dataset', {
  body: 'full/path/to/body.csv',
  file: [
    'full/path/to/meta.json',
    'full/path/to/readme.md',
    'full/path/to/structure.json'
  ]
})

// push a dataset version to a remote/qri.cloud
qri.push('me/some-cool-dataset')

// get the dataset body as a string
qri.get('me/some-cool-dataset', 'body')

// push a dataset to qri.cloud
qri.push('me/some-cool-dataset')

// list the datasets in the current qri repo
const datasets = qri.list()

Tests

Run tests with yarn test

Methods

setup(flags)

'setup' sets up a new qri repo and identity

Parameters
NameTypeDescription
flagsstring- CLI flags for 'qri setup' 
Returns
  • Promise

init(path, flags)

'init' creates a new dataset, links it to the provided directory, and creates starter files for the dataset's components

Parameters
NameTypeDescription
pathstring- the path to create the new dataset in (relative to pwd) 
flagsstring- CLI flags for 'qri init' 
Returns
  • Promise

save(dsRef, flags)

'save' saves a dataset version

Parameters
NameTypeDescription
dsRefstring- The dataset reference to save 
flagsstring- CLI flags for 'qri save' 
Returns
  • Promise

get(dsRef, component, flags)

'get' a dataset or a specific component from a dataset

Parameters
NameTypeDescription
dsRefstring- The dataset reference to save 
componentstring- The component to get (body, readme, structure, meta) 
flagsstring- CLI flags for 'qri get' 
Returns
  • Promise

remove(dsRef, flags)

'remove' removes a Dataset

Parameters
NameTypeDescription
dsRefstring- The dataset reference to save 
flagsstring- CLI flags for 'qri remove' 
Returns
  • Promise

push(dsRef, flags)

'push' pushes a Dataset to a qri remote

Parameters
NameTypeDescription
dsRefstring- The dataset reference to push 
flagsstring- CLI flags for 'qri push' 
Returns
  • Promise

Documentation generated with doxdox. (use doxdox lib/qri-node.js --layout markdown --output DOCUMENTATION.md)

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago