Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

get-ext

dfcreative11.7kMIT1.0.2

Tiny path.extname method

file, path, extname

readme

get-ext stable

Get extension from a path/filename string. Because path is too massive, and other extname-like libs are too big or wrong.

npm install get-ext

const extname = require('get-ext');

let ext = extname('./my/path/to.my/file.svg');

//ext === '.svg'