
Security News
NIST Under Federal Audit for NVD Processing Backlog and Delays
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
@tempicolabs/sdk
Advanced tools
It is the SDK for Tempico Labs API using in node.js and the browser. It is written in clean ES6 Javascript. You can try SDK in the browser or on RunKit. If you need CLI it's here (@tempicolabs/cli)
To install TmLabs for use in node or the browser with require('@tempicolabs/sdk')
, run:
npm i @tempicolabs/sdk --save
Or alternatively using Yarn, run:
yarn add @tempicolabs/sdk
dist/tmlabs.umd.js
- Standard UMD package for node.js
dist/tmlabs.es.js
- ES6 Package for node.js using import
dist/tmlabs.js
- Unminified browser version
dist/tmlabs.min.js
- Minified browser version
src/*
- Sources. Javascript ES2016
Read the full API Documentation.
Try SDK in browser or on RunKit.
SDK contain these methods:
const answer = await new TmLabs.fetch('[method_name]', {params})
It is a wrapper for API. It uses fetch-ponyfill for HTTP requests and create-hash for hashing.
<script src="https://cdn.jsdelivr.net/npm/@tempicolabs/sdk@latest/dist/tmlabs.min.js"></script>
<script>
var TmLabs = new TmLabs.default(); // or new TmLabs.TmLabs()
TmLabs.on('error', function(error, command){
console.error('[ SDK ERROR ]', error);
});
TmLabs.on('response', function(command, response){
console.info('response', response);
console.log('balanceRemaining', command.balanceRemaining); // return Remaining Balance
});
TmLabs.on('command', function(args, command){ // on command start
console.log('command', command)
});
TmLabs.fetch('dns', {
domain: 'google.com'
}).then(function(answer){
var ips = answer.content[Object.keys(answer.content)[0]];// because response will be in 'google.com' key
console.log('Google.com IPs', ips) // get array of one completed command
return TmLabs.fetch('ip', {
ip: ips[0]
})
}).then(function(answer){
console.info('google ip info', answer.content) // get info about google ip address
console.log('History after IP command', TmLabs.history) // get array of two completed commands
});
console.log('History with pending requests', TmLabs.history) // get array of two pending commands
</script>
SDK also works in node.js, using the same npm package!
var TmLabs = require('@tempicolabs/sdk').default
TmLabs.on('error', function (error, command) {
console.error(error);
});
TmLabs.on('response', function (response, command) {
console.log('response', response);
console.log('balanceRemaining', command.balanceRemaining); // return Remaining Balance
});
TmLabs.fetch('dns', {
domain: 'google.com'
}).then(function (response) {
console.log('after then response', response)
})
** You can use bundled version dist/tmlabs.umd.js
Package also contain FetchCommand Class for customizing fetch data from API. For example in ES6:
import { FetchCommand } from '@tempicolabs/sdk'
(async function() {
const command = new FetchCommand({
method: 'ip'
})
command.on('error', (error, command) => {
console.error(error);
});
command.on('response', (response, command) => {
console.log('response object', response);
console.log('response code', command.status); // same as response.status. return status code, for example 200
});
const response = await command.run({ // this response also goes to command.on('response') EventHandler if no error exists
ipaddr: '173.194.122.233' // google ip address. using alias(ipaddr)
})
console.log(response) // API response. same as command.content
})();
** You can use bundled version in dist/tmlabs.es.js
for ES6
MIT. Copyright (c) Maxim Maximov and Tempico Labs, LLC.
FAQs
Javascript SDK for TempicoLabs API
The npm package @tempicolabs/sdk receives a total of 0 weekly downloads. As such, @tempicolabs/sdk popularity was classified as not popular.
We found that @tempicolabs/sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
Research
Security News
Socket’s Threat Research Team has uncovered 60 npm packages using post-install scripts to silently exfiltrate hostnames, IP addresses, DNS servers, and user directories to a Discord-controlled endpoint.
Security News
TypeScript Native Previews offers a 10x faster Go-based compiler, now available on npm for public testing with early editor and language support.