New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

sonde

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sonde

A functional approach for API integration.

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

A functional approach for API integration.

Usage Backend

const sonde = require("sonde");

sonde.hello = () => {
  return {
    message: "world";
  };
};

sonde.greetings = (name) => {
    return `Greetings ${name}. This is from Sonde or in english, Probe.`
}

// With Express Framework, but feel free to use anything you want.

// Express Setup here. BodyParser is required to parse the body into JSON.

app.get("/sondeapi", (req, res) => {
  res.json(sonde(req.body.name, ...req.body.args));
  // req.body.name : name of the "function" called.
  // req.body.args : arguments of the "function" called.
});

Usage Frontend

<!-- in the head -->
<script src="https://cdn.jsdelivr.net/gh/STR1Z/sonde/frontend/sonde.js"></script>

<!-- fetching from the backend -->
<h1 sonde="hello">{{hello.message}}</h1>
<!-- "hello" is the "function" name. -->
// in javascript code...
sonde("greetings", "George").then((res) => console.log(res));
// Hooray for Promises

Keywords

api

FAQs

Package last updated on 01 Jul 2020

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