Using the plugins in NodeJS
See original GitHub issueHow can the plugins be used in NodeJS when importing like:
import Prism from 'prismjs';
I tried to access the line-numbers plugin, but when I do Prism.plugins
it’s an empty object.
Any ideas?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:16
- Comments:23 (8 by maintainers)
Top Results From Across the Web
Build a Plugin System With Node.js - Fusebit
Writing a plugin system enables your application to be extensible, modular, and customizable. This is a guiding principle for the most ...
Read more >Build A Plugin System — Node.js | Medium
A plugin is an extra piece of code that expands what a program can normally do. Web extensions are a good example of...
Read more >Plugin architecture in JavaScript and Node.js with Plug and Play
Plug and Play helps library and application authors to introduce a plugin architecture into their code. It simplifies complex code execution ...
Read more >node-plugins - npm
An extension-point based open plugin framework. Latest version: 1.0.3, last published: 2 years ago. Start using node-plugins in your project ...
Read more >How to build a plugin system with Node.js - Technology Blog
How to build a plugin system with Node.js ... If you're building a minimalist product, but want to add an extra level of...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I was really expecting Prism’s line number support to work from node. Found this issue and I’m quite bummed.
I’m using node.js to generate static html files from code, formatting them with prismjs, so there’s no DOM to access.
AFAICT currently some plugins are using Node’s
global
object to pick upPrism
and register the plugins. The following two work, but other plugins do not do this. Ultimately the best solution is probably to copy the body of theIIFE
s in those files in to the file where you requirePrism
.