HEX
Server: Apache
System: Linux webd004.cluster130.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
User: frenchy (106757)
PHP: 7.4.33
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/f/r/e/frenchy/www/french-american.org/current/node_modules/@allmarkedup/fang/README.md
# Fang

A tiny utility to get language information about a file.

Simply checks the file extension against Github's list of known languages. If you need something more robust (but likely slower) then other solutions are available :-)

## Installation

```shell
$ npm install @allmarkedup/fang --save
```

## Usage

The `fang` module exports a single function with the following signature:

```js
fang(<path-to-file>);
```

And returns and object with known information about the language, or `undefined` if not recognised). For example:

```js
const fang = require('@allmarkedup/fang');

console.dir(fang('assets/styles/main.scss'));

// Outputs:
// {
//     "name":  "SCSS",        // Language name
//     "mode":  "scss",        // ACE editor mode
//     "scope": "source.scss", // TextMate/Sublime scope
//     "color": "#CF649A"      // Github UI color
// }
```

# Credits

All language information is taken from [Github's Linguist](https://github.com/github/linguist/blob/master/lib/linguist/languages.yml) gem.