# @types/mmmagic

> TypeScript definitions for mmmagic

Latest version **0.4.33** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/mmmagic
pnpm add @types/mmmagic
yarn add @types/mmmagic
bun add @types/mmmagic
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.4.33 |
| Published | 2023-11-07 |
| First published | 2016-05-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51446 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/mmmagic
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mmmagic
- npm.io page: https://npm.io/package/@types/mmmagic

## Dependencies (1)

- [@types/node](https://npm.io/package/@types/node.md) *

## Recent versions

- 0.4.33 (latest) — 2023-11-07
- 0.4.30 (ts3.1) — 2020-09-09
- 0.4.29 (ts2.0) — 2016-09-19
- 0.4.32 — 2023-10-18
- 0.4.31 — 2023-09-27
- 0.4.28 — 2016-07-14
- 0.4.27-alpha — 2016-07-08
- 0.4.26-alpha — 2016-07-04
- 0.4.25-alpha — 2016-07-02
- 0.4.24-alpha — 2016-07-01
- 0.4.23-alpha — 2016-07-01
- 0.4.22-alpha — 2016-05-25
- 0.4.21-alpha — 2016-05-20
- 0.4.16-alpha — 2016-05-19
- 0.4.15-alpha — 2016-05-17

## README

# Installation
> `npm install --save @types/mmmagic`

# Summary
This package contains type definitions for mmmagic (https://github.com/mscdex/mmmagic).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mmmagic.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mmmagic/index.d.ts)
````ts
/// <reference types="node" />

/**
 * callback for detect() and detectFile()
 * Result is a string, except when MAGIC_CONTINUE is set,
 * then it is an array of string
 */
type DetectionCallback = (err: Error, result: string | string[]) => void;

export type bitmask = number;
export declare class Magic {
    constructor(magicPath?: string, mask?: bitmask);
    constructor(mask?: bitmask);
    detectFile(path: string, callback: DetectionCallback): void;
    detect(data: Buffer, callback: DetectionCallback): void;
}
export declare var MAGIC_NONE: bitmask; // no flags set
export declare var MAGIC_DEBUG: bitmask; // turn on debugging
export declare var MAGIC_SYMLINK: bitmask; // follow symlinks (default for non-Windows)
export declare var MAGIC_DEVICES: bitmask; // look at the contents of devices
export declare var MAGIC_MIME_TYPE: bitmask; // return the MIME type
export declare var MAGIC_CONTINUE: bitmask; // return all matches (returned as an array of strings)
export declare var MAGIC_CHECK: bitmask; // print warnings to stderr
export declare var MAGIC_PRESERVE_ATIME: bitmask; // restore access time on exit
export declare var MAGIC_RAW: bitmask; // don't translate unprintable chars
export declare var MAGIC_MIME_ENCODING: bitmask; // return the MIME encoding
export declare var MAGIC_MIME: bitmask; // (export var MAGIC_MIME_TYPE | export var MAGIC_MIME_ENCODING)
export declare var MAGIC_APPLE: bitmask; // return the Apple creator and type
export declare var MAGIC_NO_CHECK_TAR: bitmask; // don't check for tar files
export declare var MAGIC_NO_CHECK_SOFT: bitmask; // don't check magic entries
export declare var MAGIC_NO_CHECK_APPTYPE: bitmask; // don't check application type
export declare var MAGIC_NO_CHECK_ELF: bitmask; // don't check for elf details
export declare var MAGIC_NO_CHECK_TEXT: bitmask; // don't check for text files
export declare var MAGIC_NO_CHECK_CDF: bitmask; // don't check for cdf files
export declare var MAGIC_NO_CHECK_TOKENS: bitmask; // don't check tokens
export declare var MAGIC_NO_CHECK_ENCODING: bitmask;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 09:09:39 GMT
 * Dependencies: [@types/node](https://npmjs.com/package/@types/node)

# Credits
These definitions were written by [Andrei Sebastian Cîmpean](http://andreime.com/).

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