• Stars
    star
    3
  • Rank 3,963,521 (Top 79 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 7 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Finds an extension of given file

ext-finder

npm version code style GitHub license

Finds an extension of given filenames

Instalation

CLI

$ npm i ext-finder -g

Lib

npm i ext-finder --save

Usage

CLI

Usage: ext-finder [files] [options]

Options:
  --version, -v  Show version [boolean]
  --help,    -h  Show help    [boolean]

Examples:
  ext-finder text.txt             | Get extension of "text.txt" file
  ext-finder text1.txt text2.txt  | Get extensions of several files
  ext-finder "new text.txt"       | Get extensions of file with spaces in name

Lib

import extFinder from 'ext-finder'

// use

let extension = extfinder.getExtension("file.txt")
// 'txt'

let allExtensions = extFinder.(['file1.txt', 'file2.js', 'file3'])
// ['txt', 'js', undefined]

License

Copyright (c) 2017 dolfbarr

Licensed under the MIT license