https://github.com/wellsjo/console.save
Console hack that enables you to save JSON objects from the browser to disk
https://github.com/wellsjo/console.save
Last synced: 3 months ago
JSON representation
Console hack that enables you to save JSON objects from the browser to disk
- Host: GitHub
- URL: https://github.com/wellsjo/console.save
- Owner: wellsjo
- Created: 2014-11-02T13:19:42.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-12-12T17:18:02.000Z (over 9 years ago)
- Last Synced: 2024-12-28T13:18:55.125Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 9.77 KB
- Stars: 6
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# console.save
This script extends the `console` object in the browser and allows you to save JSON objects to your desktop. I find this to be very useful for web scraping.The way it works is it creates a phantom download link to a `Blob` of the JSON object and spoofs the user clicking it. You can use it by copy and pasting the script into the console, or use it programmatically by including the file.
## Example
Console
```JavaScript
// paste cs.js in here to gain access to console.savevar data = {
foo: "bar",
baz: "qux"
};console.save(data, 'data.json');
```
data.json
```json
{
"foo": "bar",
"baz": "qux"
}
```