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

ext-name

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ext-name

Get the file extension and MIME type from a file

  • 5.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.3M
increased by3.38%
Maintainers
1
Weekly downloads
 
Created

What is ext-name?

The ext-name npm package is used to get the file extension name from a given file path or URL. It is a simple utility that helps in extracting the extension part of a file name.

What are ext-name's main functionalities?

Get file extension from a file path

This feature allows you to extract the file extension and its corresponding MIME type from a given file path.

const extName = require('ext-name');
const filePath = 'example/file.txt';
const extension = extName(filePath);
console.log(extension); // { ext: 'txt', mime: 'text/plain' }

Get file extension from a URL

This feature allows you to extract the file extension and its corresponding MIME type from a given URL.

const extName = require('ext-name');
const url = 'http://example.com/file.txt';
const extension = extName(url);
console.log(extension); // { ext: 'txt', mime: 'text/plain' }

Other packages similar to ext-name

Keywords

FAQs

Package last updated on 07 Jun 2017

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