Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

amazon-helpers

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amazon-helpers

Some tiny helper functions for Amazon URLs

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-70%
Maintainers
1
Weekly downloads
 
Created
Source

Amazon Helpers Build Status

Tiny helper library to extract an ASIN/ISBN number from an Amazon URL or create a (optionally localized) Amazon URL out of an ASIN/ISBN.

Installation

npm install amazon-helpers

Usage

Just require the library like any other npm module:

var amazonHelpers = require('amazon-helpers');

Methods

.getIdent(urlOrAsin)

amazonHelpers.getIdent('http://www.amazon.com/gp/product/B000MTST70/')

=> B000MTST70


.getProductUrl(urlOrAsin[, tld])

amazonHelpers.getProductUrl('B000MTST70')

=> http://www.amazon.com/dp/B000MTST70

You can specify a TLD as second argument to convert your URL to another country amazonHelpers.getProductUrl('http://www.amazon.com/dp/B000MTST70', 'co.uk')

=> http://www.amazon.co.uk/dp/B000MTST70

Attention: The library does not check if the product exists in the given TLD!


.getIdentByUrl(urlOrAsin)

amazonHelpers.getIdentByUrl('http://amazon.com/gp/product/B00L3KNWBU')

=> { asin: 'B00L3KNWBU', tld: 'com' }


For more examples have a look at the tests.

License

Licensed unter MIT.

Keywords

FAQs

Package last updated on 10 May 2016

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc