I’m trying to get Typed.JS with the express framework and ejs but having difficulty getting it to work.
I’ve installed and required typed.js and jquery in my app.js file but getting an error when importing from the library for some reason.
I’ve also tried to just link typed.js through CDN and putting the javascript in a script tag in the ejs template but no luck
//set all the dependencies in app.js
var express = require("express"),
app = express(),
bodyParser = require ("body-parser"),
mongoose = require("mongoose"),
methodOverride = require("method-override"),
jquery = require("jquery"),
Typed = require("typed.js");
//Routes in app.js
app.get("/", function(req, res){
res.render("index", {Typed: Typed});
});
// In the index.ejs file
Typed.js is a JavaScript library.
It types out sentences.
Gurpreet Singh Padam