# ajsharp-attr-accept

> JavaScript implementation of the "accept" attribute for HTML5

Latest version **1.1.1** (published 2018-02-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install ajsharp-attr-accept
pnpm add ajsharp-attr-accept
yarn add ajsharp-attr-accept
bun add ajsharp-attr-accept
```

## Health

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

Positive: no vulnerabilities; high maintenance score.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2018-02-07 |
| First published | 2018-02-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 1 |
| Unpacked size | 18.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 120 |
| Author | Andrey Okonetchnikov @okonetchnikov |
| Maintainers | ajsharp |
| Keywords | html5, input, tag, attribute, attr, accpet, file |

## Links

- npm: https://www.npmjs.com/package/ajsharp-attr-accept
- Repository: https://github.com/okonet/attr-accept
- Homepage: https://github.com/okonet/attr-accept#readme
- Issues: https://github.com/okonet/attr-accept/issues
- npm.io page: https://npm.io/package/ajsharp-attr-accept

## Dependencies (1)

- [core-js](https://npm.io/package/core-js.md) 1.2.2

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 1.1.1 (latest) — 2018-02-07
- 1.1.0 — 2018-02-07

## README

# attr-accept
JavaScript implementation of the "accept" attribute for HTML5 `<input type="file">`

[![Build Status](https://travis-ci.org/okonet/attr-accept.svg?branch=master)](https://travis-ci.org/okonet/attr-accept)
[![npm version](https://badge.fury.io/js/attr-accept.svg)](https://badge.fury.io/js/attr-accept)

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input#Attributes for more information.

Installation
=====
```sh
npm install --save attr-accept
```

Usage
=====
```javascript
var accept = require('attr-accept');
accept({
    name: 'my file.png',
    type: 'image/png'
}, 'image/*') // => true

accept({
    name: 'my file.json',
    type: 'application/json'
}, 'image/*') // => false

accept({
    name: 'my file.srt',
    type: ''
}, '.srt') // => true
```

You can also pass multiple mime types as a comma delimited string or array.
```javascript
accept({
    name: 'my file.json',
    type: 'application/json'
}, 'application/json,video/*') // => true

accept({
    name: 'my file.json',
    type: 'application/json'
}, ['application/json', 'video/*']) // => true
```

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