Coder Social home page Coder Social logo

lib-js's Introduction

StdLib JavaScript (Web) Bindings

StdLib Setup | Node | Python | Ruby | Web

Basic JavaScript (Web) bindings for StdLib service accession.

Used to interface with services built using StdLib and the StdLib Command Line Tools. You can utilize any service on StdLib without installing any additional dependencies, and when you've deployed services to StdLib, you have a pre-built web-based SDK --- for example;

lib.yourUsername.hostStatus({name: 'Dolores Abernathy'}, (err, result) => {

  // handle result

});

To discover StdLib services, visit https://stdlib.com/search. To build a service, get started with the StdLib CLI tools.

Installation

Simply save the lib.js file from this package anywhere in your web project, and link it in the <head> element of an HTML file before any <script>s that require it.

<script src="path/to/lib.js"></script>

Usage

Here are some fictional calling examples for a user named user with a "hello world" service, helloWorld, that takes one parameter (named name) and is released to both a dev and release environment (with version 0.1.1).

// Unnamed Parameters
lib.user.helloWorld('world', (err, result) => {});

// Named Parameters
lib.user.helloWorld({name: 'world'}, (err, result) => {});

// Environment Specified
lib.user.helloWorld['@dev']('world', (err, result) => {});

// Release Version (SemVer) Specified
lib.user.helloWorld['@0.1.1']('world', (err, result) => {});

// Promise
lib.user.helloWorld('world')
  .catch(err => {})
  .then(result => {});

// Async
let hello = await lib.user.helloWorld('world');

// For HTTP header information, use callback-style
lib.user.helloWorld('hello', (err, result, headers) => {});

Additional Information

To learn more about StdLib, visit stdlib.com or read the StdLib CLI documentation on GitHub.

You can follow the development team on Twitter, @StdLibHQ

StdLib is © 2016 - 2017 Polybit Inc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.