filename2shiki
v1.1.0
Published
filename to Shiki language
Downloads
3
Readme
filename2shiki
filename to Shiki language
Please note that this is a pure ESM package
Installation
npm install filename2shiki
Usage
import * as filename2shiki from 'filename2shiki'
import path from 'node:path'
// get only filename
const filename = path.basename('src/main.rs') // 'main.rs'
// use fineOne to get one language
const language = filename2shiki.findOne(filename) // 'rust'
// use findAll to get all languages
const languages = filename2shiki.findAll(filename) // ['rust', 'xml']