New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

logworks

Package Overview
Dependencies
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

logworks

Logworks API wrapper

  • 7.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Logworks node.js bindings

Node library to access the Logworks API using Immutable collections Expects Fetch and Promise.

Installation

$ npm install logworks

Usage

See https://github.com/logworks/logworks-test

Overview

Every resource is accessed via your logworks instance:

var logworks = require('logworks')('logworks_api_url');
// logworks.{ RESOURCE NAME }.{ METHOD NAME }

Every resource method accepts an optional callback as the last argument:

logworks.logs.create(function(err, log) {
  err; // null if no error ocurred
  log; // Immutable Map with 'id', 'data' and 'entries' where 'data' is an Immutable Map and 'entries' is an Immutable List
}

Additionally, every resource method returns a promise, so you don't have to use the regular callback, e.g:

// Create a new log and then a new entry in that log:
logworks.logs.create().then(function(log) {
  return logworks.entries.create(log.id, {type:'text', data:'Hello World'});
}).then(function(entry) {
  entry; // Immutable map with 'id', 'type', 'data', 'created' and 'updated'
  // New entry was created
}, function(err) {
  // Deal with the error
}); 

Available resources & methods

  • logs

    • create()
    • show(logurl)
    • edit(logid, data)
    • del(logid)
    • generateSignedURL(logid)
  • entries

    • create(logid, {type: "type", data: "data"})
    • edit(logid, entryid, {type: "type", data: "newdata"})
    • del(logid, entryid)

Notes

generateSignedURL generates URLs that can be used to upload images. The response looks like {signedURL: 'foo', url: 'bar'} where url is the url that the image will be accessible on, and signedURL is the url that you should use to upload the image.

FAQs

Package last updated on 05 Nov 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc