{"id":15364694,"url":"https://github.com/bencode/get-annotation","last_synced_at":"2025-10-11T03:30:33.330Z","repository":{"id":57250081,"uuid":"59130096","full_name":"bencode/get-annotation","owner":"bencode","description":"get annotation from source","archived":true,"fork":false,"pushed_at":"2016-06-22T02:25:05.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-19T15:47:19.008Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bencode.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-18T15:50:26.000Z","updated_at":"2024-09-26T02:01:36.000Z","dependencies_parsed_at":"2022-08-24T16:51:52.827Z","dependency_job_id":null,"html_url":"https://github.com/bencode/get-annotation","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bencode%2Fget-annotation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bencode%2Fget-annotation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bencode%2Fget-annotation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bencode%2Fget-annotation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bencode","download_url":"https://codeload.github.com/bencode/get-annotation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236031051,"owners_count":19084025,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T13:13:05.255Z","updated_at":"2025-10-11T03:30:28.054Z","avatar_url":"https://github.com/bencode.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# get-annotation\n\n\n[![NPM version][npm-image]][npm-url]\n[![build status][travis-image]][travis-url]\n[![Test coverage][coveralls-image]][coveralls-url]\n\n\n从源码中解析注解字段\n\n\n```js\nconst body = `\n/*\n *\n * @entry\n *\n * @path: /a/b-c/hello\n *\n * @lessbuild: false\n *\n * @ignore: true\n *\n * @webpack.entry\n *\n * @server.url: http://www.google.com\n *\n * @count: 1234\n * @price: 12.34\n */\n...some code\n`\n\nconst getAnnotation = require('get-annotation');\n\ngetAnnotation(body, 'entry')            // true\ngetAnnotation(body, 'path')             // '/a/b-c/hello'\ngetAnnotation(body, 'lessbuild')        // false\ngetAnnotation(body, 'ignore')           // true\ngetAnnotation(body, 'webpack.entry')    // true\ngetAnnotation(body, 'server.url')       // 'http://www.google.com'\ngetAnnotation(body, 'count')            // 1234\ngetAnnotation(body, 'price')            // 12.34\n```\n\n[npm-image]: https://img.shields.io/npm/v/get-annotation.svg?style=flat-square\n[npm-url]: https://www.npmjs.com/package/get-annotation\n[travis-image]: https://img.shields.io/travis/bencode/get-annotation/master.svg?style=flat-square\n[travis-url]: https://travis-ci.org/bencode/get-annotation\n[coveralls-image]: https://img.shields.io/codecov/c/github/bencode/get-annotation.svg?style=flat-square\n[coveralls-url]: https://codecov.io/github/bencode/get-annotation?branch=master\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbencode%2Fget-annotation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbencode%2Fget-annotation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbencode%2Fget-annotation/lists"}