@davidlj95/ngx-meta

中文文档
22.0.0发布于 2026/10/26MITTypeScriptES Module构建来源已验证近 30 天下载 2621

Set your Angular site's metadata: standard meta tags, Open Graph, Twitter Cards, JSON-LD structured data and more. Supports SSR (and Angular Universal). Use a service. Use routes' data. Set it up in a flash! 🚀

原始使用文档
文档目录4 节
  1. Motivation
  2. 🗺️ Start exploring
  3. New users
  4. Existing users

<ngx-meta/> for Angular

Angular Supports Angular SSR/Universal

NPM Downloads NPM License NPM Version CI/CD workflow Codecov GitHub last commit (branch)

Coded in Typescript Git GitHub Package manager: pnpm Unit tests with Jasmine Unit tests ran by Karma E2E tests with Cypress Code coverage with Codecov Linted with ESLint Formatted with Prettier Commits follow Conventional Commits convention Git hooks with Husky GitHub Actions Released with Semantic Release Dependencies updated with Renovate Docs with Material for Mkdocs API Report/Docs with API Extractor Contributor Covenant

Set your Angular site's metadata: standard meta tags, Open Graph, Twitter Cards, JSON-LD structured data and more. Supports SSR (and Angular Universal). Use a service. Use routes' data. Set it up in a flash! 🚀

Motivation

You have a nice Angular-powered website. You want to improve its SEO and decide to add some metadata in your pages. You also enable Server Side Rendering (SSR) so when search engines visit your site, metadata elements are already in the HTML returned by the server. You start adding nice <meta name="description"> to describe your home page. Then Open Graph metadata like <meta property="og:title"> to customize social cards / link previews. You use Angular's Meta APIs to insert those in your DOM. All good so far 😊

Now, you want to set metadata for another page of your site 🤔

Calls to Angular Meta APIs start appearing in many places around. Object literals specifying <meta> definitions breed like rabbits 🐇 You also have to ensure when changing pages that metadata from a page doesn't stay there when visiting another. It's all starting to be a bit tedious 😅

If only there was a way to easily specify metadata I want for each page in a declarative fashion and forget about it 🙏 You're in the right place then 🎉 This library will definitely help you 🥳

🗺️ Start exploring

New users

First, welcome 🥰

Wondering why this library and not another one? Take a look at why section. Probably, the most interesting parts are features and comparison pages.

For the hands-on devs (this is the way), get started now ⚡️

Existing users

Take a look at guides to refresh your knowledge. Like the one about setting metadata programmatically using the service, in a declarative fashion using route's data. Or how metadata values JSON is shaped.

Go deeper by:

Are you by any chance looking for the API reference?

If you see some deprecations and want to fix them, take a look at the migrations section in the docs site

版本与发布记录

@davidlj95/ngx-meta 共发布 91 个版本,首次发布于 2023/11/23;过去 12 个月发布了 3 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
22.0.0latest2026/10/2617 天前
21.0.12026/01/0410 个月前
21.0.02026/01/0310 个月前
20.0.1release-v202025/08/221.2 年前
20.0.02025/06/031.4 年前
17.0.0release-v172025/04/281.5 年前

其他发布通道:release-v19 → 19.0.0,release-v18 → 18.0.0,release-v17 → 17.0.0,release-v20 → 20.0.1。

关于 @davidlj95/ngx-meta 的常见问题

@davidlj95/ngx-meta 是什么?

Set your Angular site's metadata: standard meta tags, Open Graph, Twitter Cards, JSON-LD structured data and more. Supports SSR (and Angular Universal). Use a service. Use routes' data. Set it up in a flash! 🚀

如何安装 @davidlj95/ngx-meta?

在项目目录运行 npm install @davidlj95/ngx-meta,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@angular/core(^22 || ^21 || ^20)、@angular/common(^22 || ^21 || ^20)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@davidlj95/ngx-meta 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@davidlj95/ngx-meta 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@davidlj95/ngx-meta 可以商用吗?

@davidlj95/ngx-meta 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@davidlj95/ngx-meta 的下载量有多少?

根据 npm 官方下载统计,@davidlj95/ngx-meta 在 2026/10/12 – 2026/11/10 这 30 天内被下载 2,621 次,日均约 87 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@davidlj95/ngx-meta 还在维护吗?

最新版本 22.0.0 发布于 2026/10/26(17 天前);至今共发布 91 个版本,其中过去 12 个月发布了 3 个;首次发布于 2023/11/23。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。