# get-annotation

> 从源码中解析注解字段

Latest version **1.1.0** (published 2016-05-19) · ISC license · 0 weekly downloads

## Install

```sh
npm install get-annotation
pnpm add get-annotation
yarn add get-annotation
bun add get-annotation
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2016-05-19 |
| First published | 2016-05-18 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | bencode@163.com |
| Maintainers | bencode |

## Links

- npm: https://www.npmjs.com/package/get-annotation
- Repository: https://github.com/bencode/get-annotation
- Homepage: https://github.com/bencode/get-annotation#readme
- Issues: https://github.com/bencode/get-annotation/issues
- npm.io page: https://npm.io/package/get-annotation

## Recent versions

- 1.1.0 (latest) — 2016-05-19
- 1.0.0 — 2016-05-18

## README

# get-annotation


[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![Test coverage][coveralls-image]][coveralls-url]


从源码中解析注解字段


```
const body = `
/*
 *
 * @entry
 *
 * @path: /a/b-c/hello
 *
 * @lessbuild: false
 *
 * @ignore: true
 *
 * @webpack.entry
 *
 * @server.url: http://www.google.com
 *
 * @count: 1234
 * @price: 12.34
 */
...some code
`

const getAnnotation = require('get-annotation');

getAnnotation(body, 'entry')            // true
getAnnotation(body, 'path')             // '/a/b-c/hello'
getAnnotation(body, 'lessbuild')        // false
getAnnotation(body, 'ignore')           // true
getAnnotation(body, 'webpack.entry')    // true
getAnnotation(body, 'server.url')       // 'http://www.google.com'
getAnnotation(body, 'count')            // 1234
getAnnotation(body, 'price')            // 12.34
```

[npm-image]: https://img.shields.io/npm/v/get-annotation.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/get-annotation
[travis-image]: https://img.shields.io/travis/bencode/get-annotation/master.svg?style=flat-square
[travis-url]: https://travis-ci.org/bencode/get-annotation
[coveralls-image]: https://img.shields.io/codecov/c/github/bencode/get-annotation.svg?style=flat-square
[coveralls-url]: https://codecov.io/github/bencode/get-annotation?branch=master

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