Skip to content

frozzare/remove-ext

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

remove-ext Build Status

Remove the extension from the string path to file. It's similar to path.basename.

Install the module with: npm install remove-ext

Example

var rmExt  = require('remove-ext')
    path   = '/path/to/gif.gif',
    result = rmExt(path, 'gif');

console.log(result); // 'path/to/gif'

Remove extension without knowing which extension it is:

var rmExt  = require('remove-ext')
    path   = '/path/to/image.png',
    result = rmExt(path);

console.log(result); // 'path/to/image'

License

MIT © Fredrik Forsmo

About

Remove the extension from the string path to file

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published