Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8810319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:05:47+00:00 2026-06-14T03:05:47+00:00

I am a complete beginner with node.js. What I try to do is to

  • 0

I am a complete beginner with node.js.

What I try to do is to parse a jsrender template on server side

I donwloaded jsrender.js from git

this is my attempt … saved as render.js:

var data = [
    {id:1, name:"tom"},
    {id:2, name:"jack"},
]

require('./jsrender.js', function(jsrender){
    console.log('test');
    var result = jsrender.render['<p>{{:id}} <b>{{:name}}</p>']( data );
    console.log(result);
} );

and then runned it (node render.js)

and I get NOTHING

what am I doing wrong?

======================================================

tried this way too:

 var data = [
    {id:1, name:"tom"},
    {id:2, name:"jack"},
]
var jsrender = require('./jsrender.js');

var result = jsrender.render('<p>{{:id}} <b>{{:name}}</p>',data );
console.log(result);

and I am getting

var result = jsrender.render('<p>{{:id}} <b>{{:name}}</p>',data );
                      ^
TypeError: Object #<Object> has no method 'render'

========================================================================

tried also installing this node_jsrender module

and this syntax:

var jsrender = require('./jsrender');

process.on('start', function () {
  jsrender.template("yourtemplate", "{{:myvar}}");
  var result = jsrender.render("yourtemplate", {myvar:"Hello World!"});

  console.log(result);
});

ALSO EMPTY result 🙁

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T03:05:48+00:00Added an answer on June 14, 2026 at 3:05 am

    So first you need to install the Node.js module.

    npm install node_jsrender
    

    This will create a node_modules directory with node_jsrender directory inside. Next you need to require.

    var jsrender = require('node_jsrender');
    

    If the first parameters of the require method starts with ./ it means that you want to import a local file. Without it Node.js will look at the node_modules directory.

    jsrender.template("yourtemplate", "{{=myvar}}");
    var result = jsrender.render("yourtemplate", {myvar:"Hello World!"});
    

    I checked the syntax of that template engine and it’s {{= and not {{:?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok, I am a complete beginner to this, in fact I am still building
I like to think that recently I have moved from complete beginner to beginner.
I'm a (near complete) beginner, and this is my first foray into encryption -
I'm a complete beginner, and this is how I understand linking: Static linking copies
I am a complete beginner in asp.net, C#, etc... I saw this and this
I am a complete beginner in Flash & Actionscript. My pet project is this:
I'm a complete beginner with jQuery and I have this bit of script here
I'm a complete beginner in Node.js and I wanted to consult something I could
I'm a complete beginner in the tcl/tk world, but I've tried to research this
I am a complete beginner to J. My first attempt at writing a function

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.