Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maxmechanic/node-pinboard
A Node.js wrapper for the Pinboard API.
https://github.com/maxmechanic/node-pinboard
pinboard
Last synced: 2 days ago
JSON representation
A Node.js wrapper for the Pinboard API.
- Host: GitHub
- URL: https://github.com/maxmechanic/node-pinboard
- Owner: maxmechanic
- License: other
- Created: 2013-03-11T18:19:54.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T19:35:18.000Z (almost 2 years ago)
- Last Synced: 2024-10-29T11:13:26.760Z (about 2 months ago)
- Topics: pinboard
- Language: JavaScript
- Homepage: https://npmjs.org/package/node-pinboard
- Size: 754 KB
- Stars: 98
- Watchers: 6
- Forks: 4
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-starred-test - maxmechanic/node-pinboard - A Node.js wrapper for the Pinboard API. (JavaScript)
README
# node-pinboard
[![npm package](https://img.shields.io/npm/v/node-pinboard.svg?style=flat-square)](https://www.npmjs.org/package/node-pinboard)
[![Build Status](https://travis-ci.org/maxmechanic/node-pinboard.svg?branch=master)](https://travis-ci.org/maxmechanic/node-pinboard)A Node.js wrapper for the Pinboard API.
### Installation
npm install node-pinboard
### Available functions
node-pinboard follows the [Pinboard v1 API](https://pinboard.in/api/) with [token auth](https://pinboard.in/api/#authentication) (token can be found on [settings/password](https://pinboard.in/settings/password)).
### Errors
Under the hood, node-pinboard uses node-fetch, so API call errors will follow that library's patterns.
### Tests
npm test
To determine code coverage:
npm run coverage
### Examples
```javascript
const Pinboard = require('node-pinboard').default;
const api_token = 'user:NNNNNN';const pinboard = new Pinboard(api_token);
const options = {
url: 'https://github.com/maxmechanic/node-pinboard',
description: 'node pinboard',
tags: 'github,node-pinboard,test',
toread: 'yes'
};pinboard.add(options, (err, res) => {
console.log(res);
//{ result_code: 'done' }
});pinboard.get({ tag: 'node-pinboard' }, (err, res) => {
console.log(res);
//date: date,
//user: 'user',
//posts:
//[ { href: 'https://github.com/maxmechanic/node-pinboard',
//description: 'node pinboard',
//extended: '',
//meta: 'meta',
//hash: 'hash',
//time: 'time',
//shared: 'no',
//toread: 'yes',
//tags: 'git node-pinboard test' } ] }
});// promise version
pinboard.get({ tag: 'node-pinboard' }).then(res => {
console.log(res);
});
```