https://github.com/afeiship/strip-extname
Trim a file extension from a String.
https://github.com/afeiship/strip-extname
ext extesion extname filename strip suffix trim
Last synced: about 2 months ago
JSON representation
Trim a file extension from a String.
- Host: GitHub
- URL: https://github.com/afeiship/strip-extname
- Owner: afeiship
- License: mit
- Created: 2021-08-28T01:33:26.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-09-01T02:41:52.000Z (over 3 years ago)
- Last Synced: 2025-02-07T11:30:28.630Z (3 months ago)
- Topics: ext, extesion, extname, filename, strip, suffix, trim
- Language: JavaScript
- Homepage:
- Size: 115 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# strip-extname
> Trim a file extension from a String.[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]## installation
```shell
npm install @jswork/strip-extname
```## usage
```js
import stripExtname from '@jswork/strip-extname';const src = 'path/subpath/file.txt.js';
const result1 = stripExtname(src, true);
const result2 = stripExtname(src);//path/subpath/file
//path/subpath/file.txt
```## license
Code released under [the MIT license](https://github.com/afeiship/strip-extname/blob/master/LICENSE.txt).[version-image]: https://img.shields.io/npm/v/@jswork/strip-extname
[version-url]: https://npmjs.org/package/@jswork/strip-extname[license-image]: https://img.shields.io/npm/l/@jswork/strip-extname
[license-url]: https://github.com/afeiship/strip-extname/blob/master/LICENSE.txt[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/strip-extname
[size-url]: https://github.com/afeiship/strip-extname/blob/master/dist/strip-extname.min.js[download-image]: https://img.shields.io/npm/dm/@jswork/strip-extname
[download-url]: https://www.npmjs.com/package/@jswork/strip-extname