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

4.0.0 • Public • Published

filename2prism

Converts source code filenames to PrismJS language aliases.

Install

$ npm i filename2prism

Usage

Map a filename to its associated PrismJS language aliases:

import filename2prism from 'filename2prism'

console.log(filename2prism(`index.mjs`))
//=> ['javascript']

console.log(filename2prism(`spaghetti`))
//=> []

console.log(filename2prism(`.bash_history`))
//=> ['bash']

console.log(filename2prism(`file.d`))
//=> ['d', 'makefile']

Contributing

Stars are always welcome!

For bugs and feature requests, please create an issue.

License

MIT © Tomer Aberbach

/filename2prism/

    Package Sidebar

    Install

    npm i filename2prism

    Weekly Downloads

    137

    Version

    4.0.0

    License

    MIT

    Unpacked Size

    22.7 kB

    Total Files

    6

    Last publish

    Collaborators

    • tomeraberbach