A browser free DevTools playground for your command line.
Use the DevTools console commands you're used to without the overhead of a browser, utilising the power of Node's REPL.
Support this project
Help support the work that goes into creating and maintaining my projects and sponsor me via GitHub Sponsors.
- Bypass the REPL and execute a command on the DOM directly from the CLI with the
-script
,-s
argument. - Updated core dependencies to the latest versions
npm install -g repl-domtools
Quickly create a very basic DOM for you to play around with.
domtools
Initialise the DOM from any website, including parsing JavaScript and linked resources.
domtools --url https://defaced.dev/
$$()
is the equivalent of [...document.querySelectorAll()]
.
$()
is the equivalent of document.querySelector()
.
Display an array as an ascii table.
table(array)
Copy a string to the OS clipboard.
copy(string)
Visualise the structure of the DOM for a given node.
dom.tree(document)
Save the modified DOM to a file.
dom.save('index.html')
Return the DOM as a string.
dom.raw()
domtools -u 'https://example.com/' -s '$$("img").forEach(e => console.log(e.src))' | xargs -n 1 curl -O
If you find this project useful please considering sponsoring me on GitHub Sponsors and help support the work that goes into creating and maintaining my projects.
Sponsors are able to remove the project support message from all my CLI projects, as well as access other additional perks.
Chris Johnson - defaced.dev - @defaced.dev (Bluesky)