https://github.com/blond/file-suffix
Basename suffix
https://github.com/blond/file-suffix
complex-extension file suffix
Last synced: 6 months ago
JSON representation
Basename suffix
- Host: GitHub
- URL: https://github.com/blond/file-suffix
- Owner: blond
- License: mit
- Created: 2016-11-15T10:12:46.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-06-01T01:16:45.000Z (about 6 years ago)
- Last Synced: 2025-10-08T08:54:05.210Z (10 months ago)
- Topics: complex-extension, file, suffix
- Language: JavaScript
- Size: 82 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
file-suffix
===========
[![NPM Status][npm-img]][npm]
[![Travis Status][test-img]][travis]
[![Windows Status][appveyor-img]][appveyor]
[![Coverage Status][coveralls-img]][coveralls]
[npm]: https://www.npmjs.org/package/file-suffix
[npm-img]: https://img.shields.io/npm/v/file-suffix.svg
[travis]: https://travis-ci.org/blond/file-suffix
[test-img]: https://img.shields.io/travis/blond/file-suffix/master.svg?label=tests
[appveyor]: https://ci.appveyor.com/project/blond/file-suffix
[appveyor-img]: https://img.shields.io/appveyor/ci/blond/file-suffix/master.svg?style=flat&label=windows
[coveralls]: https://coveralls.io/r/blond/file-suffix
[coveralls-img]: https://img.shields.io/coveralls/blond/file-suffix/master.svg
A file suffix is a substring of basename after the first dot.
Install
-------
```
$ npm install --save file-suffix
```
Usage
-----
```js
const suffix = require('file-suffix');
suffix('./lib/file.js'); // ➜ js
suffix('index.html'); // ➜ html
suffix('build.tar.gz'); // ➜ tar.gz
```
Related
-------
* [file-stem](https://github.com/blond/file-stem)
License
-------
MIT © [Andrew Abramov](https://github.com/blond)