Skip to content

Latest commit

 

History

History
30 lines (19 loc) · 786 Bytes

README.md

File metadata and controls

30 lines (19 loc) · 786 Bytes

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