{"id":24358675,"url":"https://github.com/dayitv89/nodejs-image-parser","last_synced_at":"2026-04-29T03:03:59.338Z","repository":{"id":65463400,"uuid":"161324936","full_name":"dayitv89/nodejs-image-parser","owner":"dayitv89","description":"Nodejs image parser (convert images as @3x image into desired RGB, compress them, fix the names to snake_case and finally put as 1x,2x, 3x form). Good for react native/ iOS projects.","archived":false,"fork":false,"pushed_at":"2018-12-11T12:05:12.000Z","size":40,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-25T16:02:46.546Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/nodejs-image-parser","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/dayitv89.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}},"created_at":"2018-12-11T11:39:04.000Z","updated_at":"2018-12-11T12:06:02.000Z","dependencies_parsed_at":"2023-03-10T18:48:24.686Z","dependency_job_id":null,"html_url":"https://github.com/dayitv89/nodejs-image-parser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dayitv89%2Fnodejs-image-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dayitv89%2Fnodejs-image-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dayitv89%2Fnodejs-image-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dayitv89%2Fnodejs-image-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dayitv89","download_url":"https://codeload.github.com/dayitv89/nodejs-image-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243179889,"owners_count":20249187,"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":"2025-01-18T20:21:10.314Z","updated_at":"2025-12-28T06:26:42.782Z","avatar_url":"https://github.com/dayitv89.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nodejs-image-parser\n\n![https://www.npmjs.com/package/nodejs-image-parser](https://img.shields.io/badge/npm-v1.0.2-red.svg?style=flat)\n\nNodejs image parser (convert images as @3x image into desired RGB, compress them, fix the names to snake_case and finally put as 1x,2x, 3x form). Good for react native/ iOS projects.\n\nSource Image: \u003cimg src=\"./img_src/arrowNext@3x.png\"\u003e\n\nOutput: \u003cimg src=\"./img_dest/arrow_next.png\"\u003e,\u003cimg src=\"./img_dest/arrow_next@2x.png\"\u003e, \u003cimg src=\"./img_dest/arrow_next@3x.png\"\u003e\n\nSource Image: \u003cimg src=\"./img_src/search@3x.png\"\u003e\n\nOutput: \u003cimg src=\"./img_dest/search.png\"\u003e,\u003cimg src=\"./img_dest/search@2x.png\"\u003e, \u003cimg src=\"./img_dest/search@3x.png\"\u003e\n\n### Sample code\n\n```javascript\nconst ImageParser = require('./ImageParser');\n\nconst options = { srcDir: './img_src/', destDir: './img_dest/', color: { red: 0, green: 255, blue: 255 } };\nImageParser(options)\n\t.then(() =\u003e {\n\t\tconsole.log('all done');\n\t})\n\t.catch(err =\u003e {\n\t\tconsole.log(err);\n\t});\n```\n\n### Other options for Separate task\n\n#### Parse File Names : Sync return\n\n```javascript\nconst ImageParser = require('./ImageParser');\n\nconsole.log(ImageParser.parseFileName('./img_dest/', 'arrowNext@3x.png', 1)); // ./img_dest/arrow_next.png\nconsole.log(ImageParser.parseFileName('./img_dest/', 'arrowNext@3x.png', 2)); // ./img_dest/arrow_next@2x.png\nconsole.log(ImageParser.parseFileName('./img_dest/', 'arrowNext@3x.png', 3)); // ./img_dest/arrow_next@3x.png\n```\n\n#### Get file name : Promise based\n\n```javascript\nconst ImageParser = require('./ImageParser');\n\nImageParser.getFiles('./img_src').then(files =\u003e console.log(files)); // arrowNext@3x.png, search@3x.png\n```\n\n#### Change Image : Promise based\n\n```javascript\nconst ImageParser = require('./ImageParser');\nconst options = { srcDir: './img_src/', destDir: './img_dest/', file: 'arrowNext@3x.png' color: { red: 0, green: 255, blue: 255 } };\nImageParser.changeImage(options).then(() =\u003e console.log('done'));\n```\n\n#### Compress Images : Promise based\n\n```javascript\nconst ImageParser = require('./ImageParser');\nconst options = { destDir: './img_dest/', compressionSize: '50' };\nImageParser.compressImages(options).then(() =\u003e console.log('done'));\n```\n\n####\n\nVoila \u0026 Thanks, Author: **Gaurav D. Sharma**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdayitv89%2Fnodejs-image-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdayitv89%2Fnodejs-image-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdayitv89%2Fnodejs-image-parser/lists"}