filename2shiki
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

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']

Keywords

Install

DownloadsWeekly Downloads

1

Version

1.1.0

License

MIT

Unpacked Size

15.8 kB

Total Files

5

Last publish

Collaborators

  • sachinraja