New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

product-info

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

product-info

Extracts product information from web pages

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-20%
Maintainers
1
Weekly downloads
 
Created
Source

product-info

Extracts limited product information for a given web page.

Limitations

Current implementation is crude with generic (non-schema.org) websites being limited to only name and price information.

When a URL is provided the page is opened in jsdom, and is set to fetch and process external script tags. To skip this pass in the HTML of the page instead.

Installation

npm install product-info

Return

A javascript object is returned with a similar structure to the schema.org product schema; however, canonical references were removed.

Example
// Returned
{
  name: 'Blue Shirt',
  description: 'A blue colored shirt',
  offers: {
    price: '20.00',
    priceCurrency: 'USD',
    availability: 'InStock'
  }
}

Methods

Parser

parser(HTML, callback)

Method for parsing HTML into a product.

producer.parse('http://my-schema-url.org', function(err, product){
  // product returned
});
parser(URL, callback)

Method for parsing a URL into a product. Waits until all external script tags are fetched and have run.

producer.parse('http://my-schema-url.org', function(err, product){
  // product returned
});

Keywords

FAQs

Package last updated on 20 Mar 2015

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