JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q45154F
  • License MIT

Wrapper around atom-linguist

Package Exports

  • hack-linguist

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (hack-linguist) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Hack-linguist

Simple wrapper on top of atom-linguist

Installation

npm i hack-linguist
var linguist = require("hack-linguist");

API

walkIdentify: walks through a directory and identifies each file
identify: Identifies the programming language for a single file
identifySync: Identifies the programming language for a file synchronously

Report

Report is the returned object when using walkIdentifySync It holds some useful data

Read more

Examples

...
linguist.identify('YOUR_FILE', function(err, language) {
    // error -> the possible error that occurred
    // language -> the identified language
});

var language = linguist.identify('YOUR_FILE');
...
var report = walkIdentifySync('YOUR_DIRECTORY');

Todo

Create an asynchronous version of walkIdentifySync