npm.io
1.0.2 • Published 8 years ago

ad-size

Licence
MIT
Version
1.0.2
Deps
0
Size
4 kB
Vulns
0
Weekly
0

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'

Keywords