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 8403399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:19:59+00:00 2026-06-09T22:19:59+00:00

I am currently building a project with node.js in Windows. I am using a

  • 0

I am currently building a project with node.js in Windows. I am using a batch file to assemble resources and build jade templates via the command line. With Jade, I am using the switch -o to defines a JS object that fills localized content in the template

For awhile, everything worked nicely. However, changes to my JSON lookup have resulted in an error:
“The input line is too long”

Researching the error, I found that windows shell has a limit on how long your lines can be. Unfortunately, I need the whole lookup object for my project. However, I started wondering if jade can accept a path to my lookup file instead of a string with the contents of the file. Currently, I’m building the contents into a variable and calling jade with that ala:

SetLocal EnableDelayedExpansion
set content=
for /F "delims=" %%i in (%sourcedir%\assets\english.json) do set content=!content! %%i
::use the json file as a key for assembling the jade templates 
call jade %sourcedir% --out %destdir% -o"%content%"
EndLocal

If I could use a path to the lookup file, it would be much easier. However, I am usure how to do that (if it’s even possible). and Jade’s documentation is a bit lacking.

So, in short, is it possible for Jade to accept a filepath to a JS object rather than a string containing the object? Is there a better way to contruct the jade call that wont push it past the limit?

  • 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-09T22:20:01+00:00Added an answer on June 9, 2026 at 10:20 pm

    Write a node.js script that will read your “assets” and will call a jade. Something like:

    var fs = require('fs'),
        _ = require('underscore'),
        async = require('async');
    
    var sourceDir = 'path to the directory with your jade templates',
        destinationDir = 'path to the directory where you want the result html files to be contained in';
    
    async.waterfall([
        async.parallel.bind(null, {
            serializedData: fs.readFile.bind(null, 'assets/english.json'),
            files: fs.readDir.bind(null, sourceDir),
        }),
        function (result, callback) {
            var data = JSON.parse(result.serializedData),
                files = result.files;
            async.parallel(_.map(files, function (file) {
                return async.waterfall.bind(null, [
                    fs.readFile.bind(null, sourceDir + file),
                    function (jadeSource, callback) {
                        process.nextTick(callback.bind(null, jade.compile(jadeSource)(data)));
                    },
                    fs.writeFile.bind(null, destinationDir + file)
                ]);
            }), callback);
        }
    ], function (err) {
        if (err) {
            console.log("An error occured: " + err);
        } else {
            console.log("Done!");
        }
    });
    

    Then in your batch file call this script directly, instead of enumerating the directory and calling the jade manually.

    It will not only solve your problem, but also work much faster because:

    1. I/O operations are done in parallel;
    2. Node.js is only started once during the build process, as opposed to starting it for every single file as you do now.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently using ANT for building my Java project on a Windows XP machine.
I'm currently using ant for building my java project on a Windows XP machine.
I am currently building my project using windows forms and came across a minor
I am currently building my project locally using MVC. The user enters some search
Currently I have a simple maven project that is building a jar file and
I am building a console Qt project. Currently, my project file looks like this:
To generate a NuGet package I'm currently using the command: nuget pack project.csproj -Prop
Currently, when building our project we use: javac <various command line options> C:\project\CompilationHelper.java The
I have been using raphael.draggable with a project that I am currently building. I
Build started 16/11/2011 9:24:11 AM. Project C:\Builds\1\NetTellerMigration\NetTellerMigrationBuild\Sources\blah.sln on node 1 (default targets). ValidateSolutionConfiguration: Building

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.