1.0.2 • Published 6 years ago
ad-size v1.0.2
adSize
Module extracts banner's size from html file
For now it's focuses on meta tag containing width and height.
Installation
npm install ad-size
API
adSize(input, silent)
input
Type: String
Path to html file or it's content
silent
Type: Boolean
Default: true
If true
, then no errors would be thrown, and if an error occurs, the function returns null
Usage
const adSize = require('ad-size');
let html = '<html><head><meta name="ad.size" content="HEIGHT=250px,width=970"></head><body></body></html>';
let size = adSize(html);
//=> '970x250'