MenuSettings and looks / The Working Folder

Docs / Settings and looks

The Working Folder

Every Node Run works in one folder, the Working Folder. The files your Snippets write are kept there.

On this page

What it is

A Node Run starts in the Working Folder. A file your Snippet writes by a relative path, such as fs.writeFileSync('notes.txt', text), or beside __dirname, lands there. It stays after the Run and after you quit, until you empty the folder.

  • Every Node Snippet uses the same folder, so one Snippet can read a file another one wrote.
  • Everything in it is yours: JSpark keeps nothing of its own there once a Run ends. In a folder you chose, it adds one node_modules link, so your Snippets can import installed packages.
  • It is where relative paths go, not a limit. A Snippet can still read and write anywhere you can. See Outside Access.

Open it

  • Choose Run → Reveal Working Folder.
  • Or open Settings → About and click Reveal in Finder under Working folder.

Settings shows where the folder is and how much it holds.

Settings, About: the Working folder’s path, its size, and the three things you can do with it.

Change it

  1. In Settings → About, click Change… under Working folder.
  2. Pick an empty folder, or make a new one in the window that opens.

JSpark moves everything from the current folder into the new one, and Node Runs work there from then on.

It refuses a folder that isn’t empty, a folder it can’t write to, and a folder inside the current one or holding it. It says why, and nothing is moved.

If the folder you chose is missing when JSpark starts, for example on a drive that isn’t connected, JSpark goes back to its own folder and tells you. Choose your folder again in Settings when it is back.

Empty it

  1. In Settings → About, click Empty… under Working folder.
  2. Click Empty to confirm.

Every file your Snippets wrote there is deleted. This can’t be undone. The button is greyed out while the folder is empty. A Run still running keeps the file it needs.

The pictures show JSpark on a Mac. On Windows, the window looks a little different and uses Ctrl for ⌘, but everything works the same way.

Esc

Type to search every docs page.