# non-4byte-chars-pattern

> A pattern of HTML `input` element to restrict use of UTF-8 4-byte characters

Latest version **0.0.1** (published 2016-11-09) · Unlicense license · 0 weekly downloads

## Install

```sh
npm install non-4byte-chars-pattern
pnpm add non-4byte-chars-pattern
yarn add non-4byte-chars-pattern
bun add non-4byte-chars-pattern
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2016-11-09 |
| First published | 2016-11-09 |
| Weekly downloads | 0 |
| License | Unlicense |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Shinnosuke Watanabe |
| Maintainers | shinnn |
| Keywords | pattern, restrict, restriction, unicode, utf-8, byte, 4byte, utfmb4, emoji, attribute, validate, validation, input, form |

## Links

- npm: https://www.npmjs.com/package/non-4byte-chars-pattern
- Repository: https://github.com/shinnn/non-4byte-chars-pattern
- Homepage: https://github.com/shinnn/non-4byte-chars-pattern#readme
- Issues: https://github.com/shinnn/non-4byte-chars-pattern/issues
- npm.io page: https://npm.io/package/non-4byte-chars-pattern

## Dependencies (1)

- [non-4byte-chars-regex](https://npm.io/package/non-4byte-chars-regex.md) ^1.0.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.0.1 (latest) — 2016-11-09

## README

# non-4byte-chars-pattern

[![NPM version](https://img.shields.io/npm/v/non-4byte-chars-pattern.svg)](https://www.npmjs.com/package/non-4byte-chars-pattern)
[![Bower version](https://img.shields.io/bower/v/non-4byte-chars-pattern.svg)](https://github.com/shinnn/non-4byte-chars-pattern/releases)
[![Build Status](https://travis-ci.org/shinnn/non-4byte-chars-pattern.svg?branch=master)](https://travis-ci.org/shinnn/non-4byte-chars-pattern)
[![Coverage Status](https://img.shields.io/coveralls/shinnn/non-4byte-chars-pattern.svg)](https://coveralls.io/r/shinnn/non-4byte-chars-pattern)
[![dependencies Status](https://david-dm.org/shinnn/non-4byte-chars-pattern/status.svg)](https://david-dm.org/shinnn/non-4byte-chars-pattern)
[![devDependencies Status](https://david-dm.org/shinnn/non-4byte-chars-pattern/dev-status.svg)](https://david-dm.org/shinnn/non-4byte-chars-pattern?type=dev)



```javascript
import non4byteCharsPattern from 'non-4byte-chars-pattern';

const input = document.createElement('input');
input.setAttribute('pattern', non4byteCharsPattern);

input.value = 'Hello (^ ^)';
input.validity.patternMismatch; //=> false

input.value = 'Hello 🤗';
input.validity.patternMismatch; //=> true
```

## Installation

### [npm](https://www.npmjs.com/)

```
npm install non-4byte-chars-pattern
```

### [bower](https://bower.io/)

```
bower install non-4byte-chars-pattern
```

## API

### non4byteCharsPattern

Type: `String`

Note that this pattern regards an empty string `''` as valid. If you want to disallow blank input, use `required` attribute instead.

## Related project

[non-4byte-chars-regex](https://github.com/shinnn/non-4byte-chars-regex) - [`RegExp`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp) version of this module

## License

[The Unlicense](./LICENSE).

---
_Source: https://npm.io/package/non-4byte-chars-pattern · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
