JS macro

Input
Output

JSON JavaScript Macro

Sometimes a query language isn't the right tool and you just want to write code. Paste JSON, write a function like data => data.items.filter(i => i.qty > 1), and whatever it returns becomes the output. It runs in a sandbox: a separate frame with no network and no access to the page or your storage, stopped after 5 seconds.

How do I use the JS macro?

  1. Paste JSON into the input box.
  2. Write a function in the Function box: it gets the parsed JSON as data.
  3. Return the new value: an object or array becomes JSON, a string becomes text.

What does the JS macro do?

  • Plain JavaScript: map, filter, reduce, destructuring, async functions
  • console.log lines shown under the result
  • Errors point to the line in your function
  • No network and no access to the page, its data or your storage
  • Stopped after 5 seconds, so a runaway loop can't freeze the page
  • Macros that come in a share link never run until you press Run

Frequently asked questions

Is it safe to run a macro from a share link?
It won't run until you've seen it: a macro that arrives in a link waits for you to press Run. Even then it runs in a sandbox with no network, so it can't send your data anywhere.
Does it work in the browser extension?
In Chrome and Edge, yes. Firefox add-ons have no sandbox for running code you type, so use the website there.
Is my data uploaded?
No. Bracely runs entirely in your browser, so nothing you paste or open leaves your device.

More JSON tools

Bracely has more than 65 JSON tools in one page. Related ones:

Runs entirely in your browser. Nothing you paste is uploaded. Made by Saurabh Pagrut. About · Privacy policy
Last updated · Version 4.1 · Changelog
Saurabh Pagrut on GitHub · LinkedIn · X · YouTube · Instagram