Skip to content

Code Evaluation

Ashley Davis edited this page Dec 15, 2023 · 3 revisions
  • Data-Forge Notebook evaluates the code in your notebook using Node.js.
  • You can use any code that you would normally use in Node.js.
  • Asynchronous coding is supported.
  • Prior to evaluation your notebook is concatenated into a single JavaScript file.
  • JavaScript and TypeScript notebooks are automatically compiled using Babel, this allows you to use all the latest features of JavaScript and TypeScript and the code is compiled to backwards compatible JavaScript.
  • NPM modules can be used, they are automatically installed the first time you run the code.
  • NPM modules are installed in the same directory where you saved the notebook and package.json in that directory is automatically generated and updated as new modules are installed.
  • You can load your own JavaScript Node.js modules using paths relative to the directory where you saved the notebook.
  • You can use Node.js file system functions to read and write files using paths relative to the directory where you saved the notebook, for example to load a file foo.csv that is stored next to the notebook use the path ./foo.csv.
  • Code evaluation for each code cell has the current working directory (process.cwd()) set to the directory where the notebook file is saved.
  • Use the await keyword to make cell evaluation wait for an promise-based asynchronous operation to complete before continuing.
  • The code elevator tracks all asynchronous operations so even when you don't use the await keyword subsequent cells aren't evaluated until async operations in the current cell have completed.
  • Evaluation of your notebook will hang if your code hangs. If it happens stop evaluation manually by clicking the stop button.

Get Data-Forge Notebook