user10200099
user10200099

Reputation:

nodeJS using NPM modules in external script files

I am working on a markdown converter application, and using an NPM package showdown. In my app.js file I have a var showdown = require('showdown'); which is properly being added. In my front end I require a script.js which needs to use this. However, it doesn't recognize the showdown variable. The code works perfectly if I use the showdown cdn above where I include my script.js. How do I make it so that my NPM modules can be used across a project?

Upvotes: 0

Views: 64

Answers (1)

Prasanta Bose
Prasanta Bose

Reputation: 674

Here's your answer. I have forked your git repo and made changes.

Upvotes: 0

Related Questions