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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:53:04+00:00 2026-06-05T18:53:04+00:00

From http://nodejs.org/api/vm.html : JavaScript code can be compiled and run immediately or compiled, saved,

  • 0

From http://nodejs.org/api/vm.html:

JavaScript code can be compiled and run immediately or compiled, saved, and run later. […] The returned script is not bound to any global object. It is bound before each run, just for that run.

And then in the API, no method that returns any bytes, nothing. Just a “Script” object.

So, before I politely tear down this desk beneath my arms, is there any way that I can actually SAVE the compiled script, to disk? I figure it’s just ordinary raw binary data, maybe a syntax tree or whatever.

  • 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-05T18:53:05+00:00Added an answer on June 5, 2026 at 6:53 pm

    The functions you reference are for javascript being run by javascript in a new context (so it can be secure, have new features, etc)… not so much saving a pre-compiled binary…

    If you want details on how to actually reload a precompiled script, you can look at the node.js source. The ‘node.js‘ file itself, is precompiled and loaded as a binary (if you build it with this option). In doing so, it makes node start faster.

    What you should bear in mind, however, is there is little advantage to this, unless you conceive a particular process (such as node.js) using the V8 library that will run/stop/run/stop… etc. Reason being, the V8 library will only compile your script once – and will then execute it as machine code each time thereafter, or as long as the V8 library is running.

    Precompiling, and loading as a binary, will bring some significant disadvantages, including making your program architecture dependent (even across x86 32-bit versus x86_64) and so forth. So – this may not be the best design decision.

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

Sidebar

Related Questions

I'm reading the docs at http://nodejs.org/docs/v0.4.0/api/http.html#http.request , but for some reason, I can't seem
From http://developer.yahoo.com/yui/docs/YAHOO.util.DataSourceBase.html#method_sendRequest , you can see the oCallback is an object literal with the
I've installed nodeJS ( from http://nodejs.org/ ). This has installed nodeJS & npm. Then
I downloaded the nodeJs package installer for OSX http://nodejs.org/dist/v0.6.5/node-v0.6.5.pkg But when I run node
I am using the sample code from nodejs.org and trying to send the response
I am experimenting with various responses from a simple NodeJS HTTP server. The effect
From: http://ejohn.org/apps/learn/#2 Function.prototype.bind = function(){ var fn = this, args = Array.prototype.slice.call(arguments), object =
From: http://developers.soundcloud.com/docs/api/tracks#filtering I'm not sure from the docs if this functionality is available. I
From: http://developer.android.com/resources/tutorials/views/hello-gridview.html , in ImageAdapter class: imageView.setLayoutParams(new GridView.LayoutParams(85, 85)); Look at the new GridView.LayoutParams
this is copied from http://www.zenspider.com/ZSS/Products/RubyInline/Readme.html , the home of rubyinline, adding/moding as indicated in

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.