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

ac-file-extensions

Package Overview
Dependencies
Maintainers
0
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ac-file-extensions

Creates a list of file extensions and their "real" names

  • 2.0.10
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
309
increased by89.57%
Maintainers
0
Weekly downloads
 
Created
Source

AdmiralCloud File Extension List

This little helper creates a list of file extensions including their "real" name and mimetype.

Use it to determine mimetype from extenstion, a prettyfied name or vice versa.

Currently support more than 300 file types.

BREAKING CHANGES Version 2

If you upgrade to version 2, please note that there a breaking changes. While version 1 only provided a list of file extensions, version 2 can be used to easily query extensions.

Installation

Use yarn add ac-file-extensions or npm install ac-file-extensions.

After installation this package will automatically create the collection.js file from sources.

Usage

const fileExtensions = require('ac-file-extensions')

// search from mp4
const result = fileExtensions.query({ ext: 'mp4' })
console.log(result) 
// { "ext": "mp4", "name": "MPEG-4 Video", "mimetype": "video/mp4" }

// retrieve the whole list
fileExtensions.list()

You can use query with parameter:

  • ext -> will return an object for this extension
  • mimeType -> will return an array of objects matching this mimetype

Contribution

If you want to add a new file extension, choose the right folder and add it like the other file extension. Use pull requests to send updates.

To commit, add it with git-add (or any GUI) and then use "make commit" on the CLI and answer the questions there. If you're done and want to release a new version, run "make release".

Publishing to npm must be done manually.

ac-file-extensions vs file-extensions

Please note, that this package is the successor of file-extensions. That's why it starts with version 1.2.0.

Please do not use package file-extensions any longer.

  • Website
  • Twitter (@admiralcloud)
  • Facebook

License

MIT License Copyright © 2009-present, AdmiralCloud AG, Mark Poepping

FAQs

Package last updated on 22 Jul 2024

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