JS macro
Paste or drop your data here, or open a file.
New to Bracely?
Everything stays in your browser.
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?
- Paste JSON into the input box.
- Write a function in the Function box: it gets the parsed JSON as data.
- 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:
- Merge JSON
- Flatten JSON
- Convert JSON key case
- Remove nulls from JSON
- List tools
- Remove duplicates
- Unix timestamp converter
- Filter JSON fields
- JSON pipeline
- JSON Patch
- Compare JSON arrays
- Search JSON
- JSON find and replace
- JSON Formatter
- JSON Validator
- JSON Viewer
- JSON Repair
- JSON Diff
- JSON to YAML
- JSON to CSV
- jq Playground
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