# intercept-entity

> simple substring entity,decode entity and encode

Latest version **0.1.1** (published 2016-09-30) · ISC license · 0 weekly downloads

## Install

```sh
npm install intercept-entity
pnpm add intercept-entity
yarn add intercept-entity
bun add intercept-entity
```

## 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.1.1 |
| Published | 2016-09-30 |
| First published | 2016-09-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | garvin |
| Maintainers | garvin |
| Keywords | intercept, substring, entity, encode, decode |

## Links

- npm: https://www.npmjs.com/package/intercept-entity
- Repository: https://github.com/lgc/intercept-entity
- Homepage: https://github.com/lgc/intercept-entity#readme
- Issues: https://github.com/lgc/intercept-entity/issues
- npm.io page: https://npm.io/package/intercept-entity

## Dependencies (2)

- [q](https://npm.io/package/q.md) ^1.4.1
- [cheerio](https://npm.io/package/cheerio.md) ^0.22.0

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads
- [datasets-fi-postalcodes](https://npm.io/package/datasets-fi-postalcodes.md) — 1.1K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2016-09-30
- 0.1.0 — 2016-09-30
- 0.0.9 — 2016-09-30
- 0.0.8 — 2016-09-29
- 0.0.7 — 2016-09-29
- 0.0.6 — 2016-09-29
- 0.0.5 — 2016-09-29
- 0.0.3 — 2016-09-29
- 0.0.2 — 2016-09-29
- 0.0.1 — 2016-09-29

## README

# intercept-entity
simple ***intercept***,***encode***,***decode*** entity

##How to install

	npm install intercept-entity

##Usage


###intercept
+ ***Param***

```javascript
intercept([String|Array|Object],[Number],[Number|does not exist],callback);
	example:
		intercept(obj,1,20,callback);
		intercept(obj,1,callback);
```

+ ***String***

```javascript
var entities = require("intercept-entity");

//String
entities.intercept('&#x4E2D;abc&#x56FD;&#xA9;&#xFC;&#xFF;',1,5,function (result) {
    console.log(result); //abc&#x56FD;
});
```
+ ***Array*** **and** ***Object***

```javascript
var entities = require("intercept-entity");

//Array
var obj ={first:'&#x4E2D;&#x56FD;abc&#xA9;&#xFC;&#xFF;',second:[{first:'a&#x4E2D;&#x56FD;b&#xA9;&#xFC;c&#xFF;'},{second:'&#x4E2D;&#x56FD;&#xA9;&#xFC;abc&#xFF;'}]};
entities.intercept(obj,3,function (result) {
    console.log(result); //{ first: 'bc&#xA9;&#xFC;&#xFF;',second:[ { first: 'b&#xA9;&#xFC;c&#xFF;' },{ second: '&#xFC;abc&#xFF;' } ] }
});

```

###encode
+ ***encode***

```javascript
var entities = require("intercept-entity");

entities.encode('Love中国'); //Love&#x4E2D;&#x56FD;
```

###decode
+ ***decode***

```javascript
var entities = require("intercept-entity");

entities.decode('Love&#x4E2D;&#x56FD;'); //Love中国
```

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