npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

linet-sdk

v0.4.0

Published

Linet.org.il SDK for their API

Downloads

2

Readme

Linet SDK

Linet SDK for accessing Linet's API more conveniently.

Installation

npm install linet-sdk

Note!

This module has been tested and developed with node version 14. If you are experiencing any weird behavior in your project, try to test it with node version 14+.**

Configuration

  1. Create a Linet account.
  2. Go to your profile page. You can access it by clicking on the profile icon on the top corner and click on the "Update User" button, or access it from the User Management page. Then click on the "API Keys" tab and create a new API key. Don't forget to write down the hash key, as it will not be shown again.
    Tip: Ideally, a better approach is to create a dedicated API user, and create a key under this user. This way, you can limit access and see who created the documents.
  3. It is recommended to create an .env file, write your secret stuff there and load it in your code using dotenv or any preferred env loader. E.g.:
    LINET_LOGIN_ID=...
    LINET_LOGIN_HASH=...
    LINET_LOGIN_COMPANY=1

Usage

import { Linet } from 'linet-sdk';

const linet = new Linet(LINET_LOGIN_ID, LINET_LOGIN_HASH, LINET_LOGIN_COMPANY);
try {
    const result = await linet.getItemById(1);
    console.log(result);
} catch (e) {
    console.error(e);
}

There is fourth argument to the constructor called fetchFunction. This is in case you want to change the dispatcher function to some other fetch-like function.
For example:

const linet = new Linet(LINET_LOGIN_ID, LINET_LOGIN_HASH, LINET_LOGIN_COMPANY, );

Note

If you are experiencing issues with import while running your test code. Try to run the with node flag --experimental-specifier-resolution=node.

node --experimental-specifier-resolution=node test.js

Documentation

Currently supported methods:

createDocument

( documentType: number, customerName: string [, options: object = {}] )

Create a document of any type.

createAccount

( accountType: number, name: string, options: object = {} )

Create an account of any type.

createItem

( sku: string, name: string, options: object = {} )

Create a new item.

getItemBySKU

( sku: string )

Retrieve an item using only SKU identifier.

getItemById

( itemId: number )

Retrieve an item using its internal ID.

getAccountByEmail

( email: string, filter: object = {} )

Retrieve an account using only email address. In case of multiple accounts with the same email, the first found one will be fetched. You can use the filter argument, to filter by other parameters.

searchAccounts

( filter: object )

Search accounts using the provided filter.

searchItems

( filter: object )

Search items using the provided filter.