@advanced-rest-client/headers-parser-mixin

中文文档
3.2.0发布于 2020/05/08Apache-2.0ESM + CJS近 30 天下载 3228

Headers parser Polymer Mixin to be implemented to elements that needs to parse headers data

原始使用文档
文档目录9 节
  1. headers-parser-mixin
  2. Mixin deprecation notice
  3. Usage
  4. Installation
  5. As ES module
  6. In a LitElement
  7. Development
  8. Running the demo locally
  9. Running the tests

Published on NPM

Build Status

Published on webcomponents.org

headers-parser-mixin

Headers parser mixin function to be implemented with elements that parses HTTP headers.

Mixin deprecation notice

The mixing is being deprecated and implementation should move to use HeadersParser module instead.

Usage

Installation

npm install --save @advanced-rest-client/headers-parser-mixin

As ES module

import * as HeadersParser from '@advanced-rest-client/headers-parser-mixin';
const errorMessage = HeadersParser.getError('Whitespace Name: x-true');

In a LitElement

import { LitElement, html } from 'lit-element';
import { HeadersParserMixin } from '@advanced-rest-client/headers-parser-mixin';

class SampleElement extends HeadersParserMixin(LitElement) {
  render() {
    const validation = this.getHeaderError('Whitespace Name: x-true');
    return html`
    ${validation ? html`<p>${validation}<p>` : html`<p>Headers are valid</p>`}
    `;
  }
}
customElements.define('sample-element', SampleElement);

Development

git clone https://github.com/advanced-rest-client/headers-parser-mixin
cd headers-parser-mixin
npm install

Running the demo locally

npm start

Running the tests

npm test

版本与发布记录

@advanced-rest-client/headers-parser-mixin 共发布 7 个版本,首次发布于 2019/02/19;过去 12 个月发布了 0 个版本。

版本发布日期距今
3.2.0latest2020/05/086 年前
3.1.02020/04/156 年前
3.0.12020/03/026 年前
3.0.02019/07/247 年前
3.0.0-preview.32019/04/027 年前
3.0.0-preview.22019/02/197 年前

关于 @advanced-rest-client/headers-parser-mixin 的常见问题

@advanced-rest-client/headers-parser-mixin 是什么?

Headers parser Polymer Mixin to be implemented to elements that needs to parse headers data

如何安装 @advanced-rest-client/headers-parser-mixin?

在项目目录运行 npm install @advanced-rest-client/headers-parser-mixin,或使用 pnpm add / yarn add / bun add。

@advanced-rest-client/headers-parser-mixin 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/advanced-rest-client__headers-parser-mixin 是否存在。

@advanced-rest-client/headers-parser-mixin 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@advanced-rest-client/headers-parser-mixin 可以商用吗?

@advanced-rest-client/headers-parser-mixin 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@advanced-rest-client/headers-parser-mixin 的下载量有多少?

根据 npm 官方下载统计,@advanced-rest-client/headers-parser-mixin 在 2026/10/05 – 2026/11/03 这 30 天内被下载 3,228 次,日均约 108 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@advanced-rest-client/headers-parser-mixin 还在维护吗?

最新版本 3.2.0 发布于 2020/05/08(6 年前);至今共发布 7 个版本,其中过去 12 个月发布了 0 个;首次发布于 2019/02/19。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。