program-language-detector
v0.0.12
Published
A cross-platform lightweight programming language detector.
Downloads
671
Readme
program-language-detector
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
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- 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