npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

finden-filum

v1.0.5

Published

Quickly, dependency-free, check for details of any file type

Downloads

8

Readme

Finden Filum

Quickly, dependnecy-free, check for details of any file type.

Finden Filum allows a simple method of checking the category of a provided file, based on it's extension.

By passing a file or path, the extension is automatically extracted, and compared against a list of known and classified extensions to see what class it falls into, while additionally returning more information such as a short description of the purpose of the file type.

Install

To install Finden Filum simply run:

npm install finden-filum

Usage

There are two methods available to use Finden Filum:

  1. Terminal

To use Finden Filum ensure to install it globall:

npm install finden-filum -g

Then run via:

ff path/to/file.txt

Which will return the full category object in a human readable way:

> ff file.txt
> - Cateogry: text
> - Origin: Plan Text Document

Optionally, if you'd just like to receive the extension category:

> ff file.txt --extension
> txt
  1. JavaScript API

Otherwise, the more traditional usage of Finden Filum may be within a NodeJS Module:

const ff = require("finden-filum");

let ext = ff("file.txt");

The extension object returned will then contain the following API:

  • contains(<string>)

    The contains() function can receive any valid category and if the provided category is a category that is applied to the original extension passed true is returned, otherwise false is returned.

  • getCategories()

    Returns an array of all valid categories applied to the original extension provided.

  • getFull()

    Returns the full object of the original extension provided. Where the full object has the following schema:

{
  "category": "Contains an array of valid extensions, unless there is only one, which returns a string",
  "origin": "The description of the extension",
  "resourceURL": "Optionally, URL provided for the extension.",
  "description": "Optionally, a longer more detailed description of the extension."
}
  • toString()

    Returns a string of the root category.

How it works

Finden Filum's contains a large list of known and classified extensions.

Each extension is then given a set of categories, and a description. The category list contains several recognized categories, broken up into different tiers. Where the first tier is the most general category, and subsequent categories are more specific.

1st Tier Categories

  • media: Any files for serving media, such as images, video, and audio.
  • text: Any generic file that can be opened within a text editor.
  • executable: Generally a binary file, that is able to be run as an application.
  • archive: A compressed or archived file.
  • binary: A binary file.

2nd Tier Categories

  • media
    • video: Any video file.
    • audio: Any audio file.
    • image: Any image file.
  • executable
  • archive
  • text
    • source code: Programming language file.
    • data: File contains data, generally not intended to be interacted with directly.
    • office: General office files, such as Docs, PDFs, PowerPoint files etc.
    • configure: File is explicitly a configuration file.
    • version control: File is dedicated to a version control system. Likely not ever modified directly.
    • template: The file serves as a templating methodology to display it's contents.

3rd Tier Classifications

  • text
    • source code
      • script: Script files such as bash.

Origins of the Name

  • finden Is German for Find
  • filum Is Latin for "thread" otherwise the origins of the modern word "file".

Essentially, Finden Filum means Find File. Otherwise ff should be used within code.