@jswork/strip-extname

Trim a file extension from a String.

Usage no npm install needed!

<script type="module">
  import jsworkStripExtname from 'https://cdn.skypack.dev/@jswork/strip-extname';
</script>

README

strip-extname

Trim a file extension from a String.

version license size download

installation

npm install @jswork/strip-extname

usage

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.