{"id":23979439,"url":"https://github.com/astrox11/utils","last_synced_at":"2025-04-14T04:09:23.338Z","repository":{"id":267240411,"uuid":"897807145","full_name":"AstroX11/utils","owner":"AstroX11","description":"Xutils Pack","archived":false,"fork":false,"pushed_at":"2025-01-05T13:27:11.000Z","size":56,"stargazers_count":0,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-05T13:34:08.777Z","etag":null,"topics":["axios","hacktoberfest","javascript","typescript","utitlity","xstro"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AstroX11.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-12-03T09:21:06.000Z","updated_at":"2025-01-05T13:27:15.000Z","dependencies_parsed_at":"2024-12-09T08:39:45.302Z","dependency_job_id":null,"html_url":"https://github.com/AstroX11/utils","commit_stats":null,"previous_names":["astrox11/utils"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstroX11%2Futils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstroX11%2Futils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstroX11%2Futils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstroX11%2Futils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AstroX11","download_url":"https://codeload.github.com/AstroX11/utils/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232859829,"owners_count":18587633,"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":["axios","hacktoberfest","javascript","typescript","utitlity","xstro"],"created_at":"2025-01-07T09:54:28.932Z","updated_at":"2025-01-07T09:54:29.500Z","avatar_url":"https://github.com/AstroX11.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Utils Package\n\nA simple utility package for various file and data operations.\n\n## Installation\n\n```bash\nnpm install utils\n```\n\n## Usage\n\n```javascript\nimport { buffertoJson, jsontoBuffer, getBuffer, detectType } from 'utils';\n\n// Example usage\nconst buffer = await getBuffer('https://example.com/file');\nconst type = await detectType(buffer);\nconsole.log(type);\n```\n\n## Available Functions\n\n-    `buffertoJson`: Convert a buffer to JSON\n-    `jsontoBuffer`: Convert JSON to buffer\n-    `transformBuffer`: Apply a transformation to a buffer\n-    `bufferToFile`: Write a buffer to a file\n-    `toBuffer`: Convert various types to buffer\n-    `extractUrlFromString`: Extract URL from a string\n-    `getBufferFromStream`: Convert stream to buffer\n-    `getStreamFromBuffer`: Convert buffer to stream\n-    `FileTypeFromUrl`: Detect file type from URL\n-    `FileTypeFromBuffer`: Detect file type from buffer\n-    `FileTypeFromBlob`: Detect file type from blob\n-    `FileTypeFromStream`: Detect file type from stream\n-    `detectType`: Detect content type\n-    `getJson`: Fetch JSON from URL\n-    `postJson`: Send JSON to URL\n-    `getBuffer`: Fetch binary buffer from URL\n\n## License\n\nMIT\n\n````\n\nHere's what I've done:\n\n1. Implemented the TypeScript functions in `index.ts`\n2. Created a `tsconfig.json` configured for ES6 module output\n3. Updated `package.json` with:\n   - Latest dependencies\n   - ES6 module support\n   - Build scripts\n   - Added `node-fetch` for network operations\n4. Added a README with basic usage instructions\n\nTo set up the project:\n\n```bash\nnpm init -y\nnpm install file-type@18.5.1 node-fetch@3.3.2\nnpm install -D typescript @types/node @types/node-fetch\nnpx tsc  # This will generate index.js and index.d.ts\n````\n\nThe package is now set up as an ES6 module with TypeScript support. Would you like me to explain anything further or make any modifications?\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastrox11%2Futils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fastrox11%2Futils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastrox11%2Futils/lists"}