program-language-detector
TypeScript icon, indicating that this package has built-in type declarations

0.0.12 • Public • Published

program-language-detector

NPM version NPM downloads CircleCI codecov donate

A cross-platform lightweight programming language detector. (🚀 Gzip < 2KB 🚀)

Install

npm i program-language-detector
# or 
yarn add program-language-detector

Usage

const { detect, languages, LANG } = require('program-language-detector')
 
detect('const egoist = new Object();')             // => 'JavaScript'
detect('#app { font-size: 20px; }')                // => 'CSS'
detect('<div id="app"></div>')                     // => 'Html'
detect('List<String> things = new ArrayList<>();') // => 'Java'
// ...
 
languages // => A list of detectable languages
LANG // => A map of detectable languages, whose key and value are both lang name

Detectable languages

  • JavaScript
  • C
  • C++
  • Python
  • Java
  • HTML
  • CSS
  • Ruby
  • Go
  • PHP

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Author

program-language-detector © ulivz, Released under the MIT License.
Authored and maintained by ulivz with help from contributors (list).

github.com/ulivz · GitHub @ulivz

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.12337latest

Version History

VersionDownloads (Last 7 Days)Published
0.0.12337
0.0.110
0.0.100
0.0.90
0.0.80
0.0.70
0.0.61
0.0.50
0.0.40
0.0.30
0.0.21
0.0.10

Package Sidebar

Install

npm i program-language-detector

Weekly Downloads

339

Version

0.0.12

License

MIT

Unpacked Size

80.4 kB

Total Files

11

Last publish

Collaborators

  • toxichl