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.
node-easypost
Advanced tools
EasyPost is a simple shipping API. You can sign up for an account at https://easypost.com
npm install node-easypost
var apiKey = 'cueqNZUb3ldeWTNX7MU3Mel8UXtaAMUi';
var easypost = require('node-easypost')(apiKey);
// set addresses
var toAddress = {
name: "Sawyer Bateman",
street1: "1A Larkspur Cres.",
city: "St. Albert",
state: "AB",
zip: "t8n2m4",
country: "CA",
phone: "780-123-4567"
};
var fromAddress = {
name: "EasyPost",
street1: "164 Townsend St",
street2: "#1",
city: "San Francisco",
state: "CA",
zip: "94107",
phone: "415-123-4567"
};
// verify address
easypost.Address.create(fromAddress, function(err, fromAddress) {
fromAddress.verify(function(err, response) {
if (err) {
console.log('Address is invalid.');
} else if (response.message !== undefined && response.message !== null) {
console.log('Address is valid but has an issue: ', response.message);
var verifiedAddress = response.address;
} else {
var verifiedAddress = response;
}
});
});
// set parcel
easypost.Parcel.create({
predefined_package: "InvalidPackageName",
weight: 21.2
}, function(err, response) {
console.log(err);
});
var parcel = {
length: 10.2,
width: 7.8,
height: 4.3,
weight: 21.2
};
// create customs_info form for intl shipping
var customsItem = {
description: "EasyPost t-shirts",
hs_tariff_number: 123456,
origin_country: "US",
quantity: 2,
value: 96.27,
weight: 21.1
};
var customsInfo = {
customs_certify: 1,
customs_signer: "Hector Hammerfall",
contents_type: "gift",
contents_explanation: "",
eel_pfc: "NOEEI 30.37(a)",
non_delivery_option: "return",
restriction_type: "none",
restriction_comments: "",
customs_items: [customsItem]
};
// create shipment
easypost.Shipment.create({
to_address: toAddress,
from_address: fromAddress,
parcel: parcel,
customs_info: customsInfo
}, function(err, shipment) {
// buy postage label with one of the rate objects
shipment.buy({rate: shipment.lowestRate(['USPS', 'ups'])}, function(err, shipment) {
console.log(shipment.tracking_code);
console.log(shipment.postage_label.label_url);
});
});
Up-to-date documentation at: https://www.easypost.com/docs
npm test
FAQs
EasyPost Node Client Library
We found that node-easypost demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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.