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

taxcloudjs

v1.0.3

Published

TaxCloud Wrapper

Downloads

4

Readme

taxcloudjs

TaxCloud Integration - Using promises and fetch

Why this module:

  • Promises
  • Allows to use env for sensitive data without extra coding
  • Only one dependency: node-fetch
  • Active and open for Pull Requests
  • Follows TaxCloud documentation
  • Uses TaxCloud JSON faster API, not SOAP

If you think you can contribute, please do. Looking for co-maintainers.

Install

$ npm install taxcloudjs

Setting up

By default, the following environmet variables will be used if present:

  • TAXCLOUD_LOGIN_ID
  • TAXCLOUD_KEY
  • TAXCLOUD_USPS_USER_ID

You can override any of them passing properties to TaxCloud constructor:

  • apiLoginId
  • apiKey
  • USPDUserId

Example:

var props = {
  apiLoginId: 'xxxxxxxxxx', // Required
  apiKey: 'xxxxxxxxxxxxxx', // Required
  USPSUserId: 'xxxxxxxxxx'  // Optional - for address validation only
}

// using constructor
var TaxCloud = require('taxcloudjs')
var taxcloudjs = new TaxCloud(props);

// intialize factory method
var taxcloudjs = require('taxcloudjs').initialize(props);

Optional Properties

| Property | Type | Default | Description | | --- | --- | --- | --- | | maxCartSize | int | 100 | Maximun number of Items in a Cart. read TaxCloud documentation before changing this. |

Ping

var taxcloudjs = require('taxcloudjs').initialize();

taxcloudjs.ping()
.then((result) => {
  console.log(result ? 'Pong!' : 'Nothing ...');
})
.catch((err) => {
  // Handle it ...
})

More methods

Methods will receive and return what TaxCloud is expecting as JSON. Read TaxCloud documentation to learn more.

All important methods to operate with TaxCloud returns a Promise that will give you the Object returned by the API or an error to be catched with API Error code and messages depending on the method called, such as [{"ResponseType":0,"Message":"Invalid apiLoginID and/or apiKey"}].

This implementation uses TaxCloud API as is, all validation, except some basic validation done on lookup, are performed on their end and returned as errors. All methods accepts as params objects just like requested on documentation and responses are resolved as they come. Its your job to send proper information and manipulate the response.

| Method | Params | Returns | Description | | --- | --- | --- | --- | | getTICs | - | Promise:Array of Ids | Returns all available TICs | | getTICsGroups | - | Promise:Array of Groups | Returns all available TIC Groups | | getTICsByGroup | ticId:int | Promise:Array of Ids | Returns all available TICs for a Given group | | updateTICIdList | - | Promise | Updates the internal TICs cache | | isTic | ticId:int | boolean | Whether or not a given ID is in the TICs cache | | verifyAddress | cart:Object | Promise:Object | See TaxCloud docs | | lookup | cart:Object | Promise:Object | See TaxCloud docs | | authorized | transaction:Object | Promise:Object | See TaxCloud docs | | capture | transaction:Object | Promise:Object | See TaxCloud docs | | authorizedWithCapture | transaction:Object | Promise:Object | See TaxCloud docs | | returned | transaction:Object | Promise:Object | See TaxCloud docs |