# is-ad

> Function to check if a url contains ads or not.

Latest version **0.2.1** (published 2018-02-20) · MPL license · 0 weekly downloads

## Install

```sh
npm install is-ad
pnpm add is-ad
yarn add is-ad
bun add is-ad
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2018-02-20 |
| First published | 2017-03-13 |
| Weekly downloads | 0 |
| License | MPL |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 1.6 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Jensen Bernard |
| Maintainers | jense5 |
| Keywords | contains-ad, ad-block, is-ad, check, ad |

## Links

- npm: https://www.npmjs.com/package/is-ad
- Repository: https://github.com/Jense5/contains-ads
- npm.io page: https://npm.io/package/is-ad

## Dependencies (1)

- [ad-block](https://npm.io/package/ad-block.md) ^2.0.1

## Alternatives

- [csv-to-markdown-table](https://npm.io/package/csv-to-markdown-table.md) — 47.0K weekly downloads
- [@sapphire/ratelimits](https://npm.io/package/@sapphire/ratelimits.md) — 4.4K weekly downloads
- [js-csvparser](https://npm.io/package/js-csvparser.md) — 2.0K weekly downloads
- [@adadapted/js-sdk](https://npm.io/package/@adadapted/js-sdk.md) — 251 weekly downloads
- [@grapecity/spread-sheets-sparklines](https://npm.io/package/@grapecity/spread-sheets-sparklines.md) — 103 weekly downloads

## Recent versions

- 0.2.1 (latest) — 2018-02-20
- 0.2.0 — 2018-02-20
- 0.1.0 — 2017-03-14
- 0.0.3 — 2017-03-14
- 0.0.2 — 2017-03-13
- 0.0.1 — 2017-03-13
- 0.0.0-dev.0 — 2017-03-13

## README

# Contains Ads

**is-ad is deprecated, please use contains-ads**  

Function to check if a url contains ads or not.

```sh
$ yarn add contains-ads
```

### Basic Example

```js
import { initialize, containsAds } from 'contains-ads';

// Optionally pass the current url for extra precision.
initialize().then(() => {
  containsAds('http://www.twitter.com');                         // False
  containsAds('http://www.blabal.com&ad_type_');                 // True
  containsAds('http://www.blabal.com&ad_type_', 'sample.com');   // True
});
```

### Advanced Example

```js
import { initialize, containsAds, client } from 'contains-ads';

// You can also parse custom rules. Check the adblock plus docs
// for more information (https://adblockplus.org/filters).
client.parse('||blacklistwebsite.com')
client.parse('@@||whitelistwebsite.com');

initialize().then(() => {
  containsAds('http://www.blacklistwebsite.com');    // True
  containsAds('http://www.whitelistwebsite.com');    // False
});
```

### Development

```py
# Run tests with mocha.
$ yarn test

# Rebuild the blocker/blocked.txt to a buffer.
$ yarn build:detector
```

---
_Source: https://npm.io/package/is-ad · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
