GitShow/tj/ejs
tj

ejs

Embedded JavaScript templates for node

by tj
Star on GitHubForknpm

JavaScript

4.5k stars496 forks34 contributorsQuiet · 2y agoSince 2010

Meet the team

See all 34 on GitHub →
tj
tj157 contributions
mde
mde6 contributions
der-On
der-On5 contributions
JacksonTian
JacksonTian3 contributions
zerowidth
zerowidth3 contributions
jtsay362
jtsay3623 contributions
slaskis
slaskis2 contributions
mako-taco
mako-taco2 contributions

Languages

View on GitHub →
JavaScript99.2%
Makefile0.8%

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

1 of 6 standards met

Community profile →
28
✓README○License○Contributing○Code of Conduct○Issue Template○PR Template

Recent PRs & issues

Quiet · Last activity 2y ago
See all on GitHub →
RohitPaul0007
Update benchmark.jsOpenPR
RohitPaul0007 · 2y ago
RohitPaul0007
Update ejs.jsOpenPR
RohitPaul0007 · 2y ago
RohitPaul0007
Update compile.jsOpenPR
RohitPaul0007 · 2y ago

Recent fixes

View closed PRs →
sebthiriet
How to break line within <%= here is a string %>ClosedIssue

If I receive from my client a string with "Hello\nHow are you?"... Then: 1) If I do the job to replace \n by then the string that appears on the browser is: HelloHow are you? 2) If I don't replace anything, then (of course :) the string in the browser is: Hello\nHow are you? So my question is: How you guys handle the line breaking without going to go for too complex code in .ejs placeholders? Thanks, Sebastien PS: is not the right html tag for break line, I write it like this to keep it displayed in this editor

sebthiriet · 1y ago
netpoetica
Using "if" to check variable before usage results in Error, UndefinedClosedIssue

From the example in the README This code, in all situations, always results in an error if you don't pass the data to the file. I am trying to use it as, let's say, a report about whether your password was valid - if it wasn't I would render the file with But if the user were going to the login page and it hadn't yet been posted, I would just use: I could fix this by explicitly sending a msg = null to all routes, but I think that is silly. Any advice on how to properly handle this? My guess is that what I am doing is somehow unconventional in node/ejs. Thanks a bunch, Keith

netpoetica · 2y ago
marijaselakovic
use implicit string conversion instead of String constructorMergedPR

Hi, I would propose few optimizations: 1) Use implicit string conversion, instead of String constructor. Especially if the expected input is string, like in functions: capitalize, downcase, upcase, truncate, truncate_words and replace (jsperf test: http://jsperf.com/implicitstringconversion) 2) Instead of js.substr(0,1), use equivalent js[0].

marijaselakovic · 2y ago
Structured data for AI agents

Repository: tj/ejs. Description: Embedded JavaScript templates for node Stars: 4460, Forks: 496. Primary language: JavaScript. Languages: JavaScript (99.2%), Makefile (0.8%). Open PRs: 37, open issues: 80. Last activity: 2y ago. Community health: 28%. Top contributors: tj, mde, der-On, JacksonTian, zerowidth, jtsay362, slaskis, mako-taco, glsh-machine, domachine and others.

·@ofershap

Replace github.com with gitshow.dev