Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
company-api
Advanced tools
A library to lookup NUM records recursively to produce an aggregated result.
An API for aggregating NUM Contacts Module and Images Module Records into a single object using the NUM Protocol.
git clone git@github.com:NUMtechnology/company-api.git
cd company-api
npm install
test/index.html
in your browser.npm install -s company-api
const companyApi = require('company-api');
// Create an API instance
const api = companyApi.createCompanyApi();
// Use it to look up a domain
api.lookupDomain('numexample.com').then((result) => {
console.log(JSON.stringify(result));
}, (err)=>{
console.error('ERROR: ', JSON.stringify(err));
});
import { createCompanyApi } from 'company-api';
// Create an API instance
const api = createCompanyApi();
// Use it to look up a domain
api.lookupDomain('numexample.com').then((result) => {
console.log(JSON.stringify(result));
}, (err)=>{
console.error('ERROR: ', JSON.stringify(err));
});
import { createCompanyApi, CompanyApiOptions } from 'company-api';
// Create an API instance
const api = createCompanyApi();
const versionMap = new Map<number, string>();
// Module 1 (Contacts) is currently at version 2, the others will default to version 1.
// An empty map can be supplied which sets the default version for each NUM module ('2' for Contacts, '1' for everything else).
versionMap.set(1,'2');
versionMap.set(3,'1.5'); // E.g. use v1.5 of the Images module (if such a version exists)
const options = new CompanyApiOptions(
2, // The number of levels for Contacts records. 0 returns no contacts data.
1, // The number of levels for Images records. 0 returns no images data.
versionMap
);
// Use it to look up a domain
api.lookupDomain('numexample.com', options).then((result) => {
console.log(JSON.stringify(result));
}, (err)=>{
console.error('ERROR: ', JSON.stringify(err));
});
If you already have a NUMClient object you can re-use it.
import { createClient } from 'num-client';
import { createCompanyApi } from 'company-api';
// (from another part of your application)
const existingClient = createClient();
// Inject the existing client when creating the API instance
const api = createCompanyApi(existingClient);
// Use it to look up a domain
api.lookupDomain('numexample.com').then((result) => {
console.log(JSON.stringify(result));
}, (err)=>{
console.error('ERROR: ', JSON.stringify(err));
});
FAQs
A library to lookup NUM records recursively to produce an aggregated result.
We found that company-api 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.