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

hokage

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hokage - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

6

example.js

@@ -18,4 +18,4 @@ const Hokage = require('./index')

hokage.listPosts().then(resp => {
console.log(resp) // use resp.body if you need only the body
hokage.listPosts('/id').then(resp => {
// console.log(resp) // use resp.body if you need only the body
}).catch(err => {

@@ -25,3 +25,3 @@ console.log('err', err)

const newPost = await hokage.createPost({
const newPost = await hokage.createPost('/param', {
title: 'foo',

@@ -28,0 +28,0 @@ body: 'bar',

@@ -81,4 +81,12 @@ require('isomorphic-fetch');

this[name] = async (body) => {
let req = this.makeRequest(method, path, body, headers)
this[name] = async (...args) => {
let param = ''
let body = args[0]
if (args.length > 1) {
param = args[0]
body = args[1]
}
let req = this.makeRequest(method, path + param, body, headers)
let resp = this.parseResponse(await fetch(req))

@@ -85,0 +93,0 @@ return resp

{
"name": "hokage",
"version": "1.0.2",
"version": "1.0.3",
"description": "Javascript library to encapsulate API calls",

@@ -5,0 +5,0 @@ "main": "index.js",

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