1.0.6 • Published 9 months ago
ecomm-identifier v1.0.6
Usage
To use this package, import the getPlatformByUrl
function and call it with a URL as the argument:
TypeScript:
import { getPlatformByUrl } from "ecomm-identifier";
const url = "http://swiftoutside.com";
const platform = await getPlatformByUrl(url);
console.log(platform);
//{ name: 'WooCommerce', url: 'http://swiftoutside.com', success: true }
JS:
const { getPlatformByUrl } = require("ecomm-identifier");
const url = "http://swiftoutside.com";
const platform = await getPlatformByUrl(url);
console.log(platform);
//{ name: 'WooCommerce', url: 'http://swiftoutside.com', success: true }
Alternatively, you can import the getPlatformByHtml
function and call it with an HTML string as the argument:
import { getPlatformByHtml } from "ecomm-identifier";
const html = "<html><head><title>Swift Outside</title></head><body></body></html>";
const platform = await getPlatformByHtml(html);
console.log(platform);
//{ name: 'WooCommerce', url: 'http://swiftoutside.com', success: true }
const { getPlatformByHtml } = require("ecomm-identifier");
const html = "<html><head><title>Swift Outside</title></head><body></body></html>";
const platform = await getPlatformByHtml(html);
console.log(platform);
//{ name: 'WooCommerce', url: 'http://swiftoutside.com', success: true }
Supported Platforms
- BigCommerce
- Ecwid
- Lightspeed
- Magento
- Shopify
- Square
- Squarespace
- Wix
- WooCommerce
TODO:
- Add more platforms
- Add tests
- Automate deployment