2.2.1 • Published 3 years ago

prepr-nodejs v2.2.1

Weekly downloads
45
License
BSD-2-Clause
Repository
-
Last release
3 years ago

Prepr REST API for Node.js

This repository contains the open source Node.js client for Prepr REST API.

Requirements

  • Create a new access token in the developers
  • Prepr REST API for Node.js requires Node.js >= 0.10

Installation

npm install prepr-nodejs

Usage

Initialize the library first. Don't forget to replace <YOUR_ACCESS_TOKEN> with your access token.

var prepr = require('prepr-nodejs')('<YOUR_ACCESS_TOKEN>');

Now we can send API requests through node. Let's getting list as examples:

// Get publications list
prepr.get('/publications', {}, function (err, data) {
  if (err) {
    return console.log(err);
  }
  console.log(data);
});

// Result
{
  "items": [...],
  "total": 0,   
  "after": "YWZ0ZXJfMjU=",
  "before": "YmVmb3JlXzA=",
  "skip": 0,
  "limit": 25
}
// Get publications list with params
prepr.get('/publications', {
    fields: 'title,status',
    limit: 1
}, function (err, data) {
  if (err) {
    return console.log(err);
  }
  console.log(data);
});

// Result
{
  "items": [...],
  "total": 0,   
  "after": "YWZ0ZXJfMjU=",
  "before": "YmVmb3JlXzA=",
  "skip": 0,
  "limit": 25
}

Docs

For all the details and full documentation check out the Prepr Developer docs.

https://developers.prepr.io

2.2.1

3 years ago

2.2.0

3 years ago

2.1.1

3 years ago

2.0.2

3 years ago

2.1.0

3 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago