{"id":20119200,"url":"https://github.com/harrystevens/scraperama","last_synced_at":"2025-07-02T02:01:59.861Z","repository":{"id":210766599,"uuid":"310389207","full_name":"HarryStevens/scraperama","owner":"HarryStevens","description":"Scrape files from the internet.","archived":false,"fork":false,"pushed_at":"2025-06-24T19:58:00.000Z","size":93,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-24T20:15:25.800Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HarryStevens.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-11-05T18:48:44.000Z","updated_at":"2025-06-24T19:58:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"93f27750-d45b-420b-bceb-a7ee179262ec","html_url":"https://github.com/HarryStevens/scraperama","commit_stats":null,"previous_names":["harrystevens/scraperama"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/HarryStevens/scraperama","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HarryStevens%2Fscraperama","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HarryStevens%2Fscraperama/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HarryStevens%2Fscraperama/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HarryStevens%2Fscraperama/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HarryStevens","download_url":"https://codeload.github.com/HarryStevens/scraperama/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HarryStevens%2Fscraperama/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261750182,"owners_count":23204188,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T19:14:46.014Z","updated_at":"2025-07-02T02:01:59.837Z","avatar_url":"https://github.com/HarryStevens.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# scraperama\nScrape files from the internet.\n\n## Installation\n\n```bash\nnpm i scraperama -S\n```\n\n## Usage\n\n```js\nconst scraperama = require(\"scraperama\");\n\nscraperama.csv(\"file.csv\", json =\u003e {\n  console.log(json);\n});\n\nscraperama.html(\"file.html\", $ =\u003e {\n  console.log($(\"body\").html());\n});\n\nscraperama.json(\"file.json\", json =\u003e {\n  console.log(json);\n});\n\nscraperama.text(\"file.txt\", text =\u003e {\n  console.log(text);\n});\n```\n\nTo return a YYYY-MM-DD datestamp (useful for file naming):\n```js\nscraperama.datestamp(); // current date\nscraperama.datestamp(new Date(1999, 0, 1)); // \"1999-01-01\"\nscraperama.datestamp(\"foo\"); // throws a type error\n```\n\nTo download a file from the Internet:\n```js\nscraperama.download(\n  \"https://path/to/file.zip\", // URL\n  \"path/to/file.zip\", // local file path\n  (pct) =\u003e { process.stdout.write(`\\r${pct.toFixed(1)}%`); }, // log percentage downloaded\n  (err) =\u003e { \n    if (err) console.error(err);\n    console.log(\"Done!\");\n  } // callback function\n);\n```\n\nTo get an object's file size:\n```js\nscraperama.filesize(object);\n```\n\nTo throttle a function:\n```js\nconst logThrottled = scraperama.throttle(console.log, 500);\nArray.from({ length: 10 }).forEach((_, i) =\u003e logThrottled(i));\n```\n\nTo untar a local file:\n```js\nscraperama.untar(\n  \"path/to/file.tar\", // input tar file\n  \"path/to/dir\", // output directory\n  (err) =\u003e { \n    if (err) console.error(err);\n    console.log(\"Done!\");\n  } // callback function\n);\n```\n\nTo unzip a local file:\n```js\nscraperama.unzip(\n  \"path/to/file.tar\", // input tar file\n  \"path/to/dir\", // output directory\n  (err) =\u003e { \n    if (err) console.error(err);\n    console.log(\"Done!\");\n  } // callback function\n);\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharrystevens%2Fscraperama","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharrystevens%2Fscraperama","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharrystevens%2Fscraperama/lists"}