Extype
Extype is a command line tool that calculates the file type based on its extension.
motivation
while i was learning backend development, with node, i realized that there were many files that i had no idea what class they were, like workflow.yml etc...
So, i decided to create a simple command line tool that would help me solve this.
installation
can you install extype with npm:
npm install -g extype
usage
when installing it globally, you can run it like this:
extype index.html
or run it with npx:
npx extype index.html
even in the package.json, it would look something like this:
{
"scripts": {
"get-extension": "extype"
}
}
in the terminal:
npm run get-extension ./index.html
example
extype main.css
# output
result: main.css >> CSS
behavior
# help flag is ignored
extype index.html --help
extype ignore all positional arguments, which are after the first argument.
extype index.html --some-opt
# output
error: unsupported option, try --help to see supported options
extype, returns an error, if it finds an incompatible flag/option, oh that it is not inside the --help command.
license
made inder MIT license