shamanld
v1.0.0
Published
[](https://github.com/Prev/shamanjs/blob/master/LICENSE) [](https://travis-ci.org/Prev/shamanjs) [ on the CDN when serving the JS file greatly affects the time and cost to download the file.
See demo on RunKit.
Getting Started
Installation
In a browser:
<script src="dist/shaman.js"></script>Using npm:
$ npm i --save shamanldHow to use
const code = `
#include <stdio.h>
int main() {
printf("Hello world");
}`;
const r = Shaman.detect(code);
// r = [['c', 44.28, 'java', 6.3, ...]]
const detectedLanguage = r[0][0];
assert(detectedLanguage == 'c');
