Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/mmmagic

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/mmmagic

TypeScript definitions for mmmagic

  • 0.4.33
  • ts4.5
  • ts4.6
  • ts4.7
  • ts4.8
  • ts4.9
  • ts5.0
  • ts5.1
  • ts5.2
  • ts5.3
  • ts5.4
  • ts5.5
  • ts5.6
  • ts5.7
  • ts5.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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

/// <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

Credits

These definitions were written by Andrei Sebastian Cîmpean.

FAQs

Package last updated on 07 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc