{"id":15687327,"url":"https://github.com/aromalanil/get-ascii-image","last_synced_at":"2025-07-03T14:41:03.793Z","repository":{"id":143879627,"uuid":"290541462","full_name":"aromalanil/get-ascii-image","owner":"aromalanil","description":"💼 A zero dependency npm package for the web🌐 to convert images 🖼 to ASCII.","archived":false,"fork":false,"pushed_at":"2020-09-28T06:42:06.000Z","size":303,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-09T06:23:11.015Z","etag":null,"topics":["ascii-generator","ascii-image","characters","frontend-library","image-manipulation","image-processing","image-to-ascii"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/get-ascii-image","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/aromalanil.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":"aromalanil","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://paypal.me/aromalanil","https://www.buymeacoffee.com/aromalanil"]}},"created_at":"2020-08-26T15:58:19.000Z","updated_at":"2025-04-04T16:18:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"9c58f46f-0d88-41db-8852-8c29214829ec","html_url":"https://github.com/aromalanil/get-ascii-image","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/aromalanil/get-ascii-image","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aromalanil%2Fget-ascii-image","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aromalanil%2Fget-ascii-image/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aromalanil%2Fget-ascii-image/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aromalanil%2Fget-ascii-image/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aromalanil","download_url":"https://codeload.github.com/aromalanil/get-ascii-image/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aromalanil%2Fget-ascii-image/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263343216,"owners_count":23452131,"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":["ascii-generator","ascii-image","characters","frontend-library","image-manipulation","image-processing","image-to-ascii"],"created_at":"2024-10-03T17:47:18.591Z","updated_at":"2025-07-03T14:41:03.762Z","avatar_url":"https://github.com/aromalanil.png","language":"JavaScript","funding_links":["https://ko-fi.com/aromalanil","https://paypal.me/aromalanil","https://www.buymeacoffee.com/aromalanil"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\t\u003cimg src=\"https://github.com/aromalanil/get-ascii-image/blob/master/demo/cover_image.jpg?raw=true\" alt=\"Cover Image\"\u003e\u003c/img\u003e\n    \u003ch1\u003eget-ascii-image\u003c/h1\u003e\n    \u003cp\u003eA zero dependency image to ascii convertor for Web🌐\u003c/p\u003e\n\t\u003cbr/\u003e\n\t\u003cdiv align=\"center\"\u003e\n\t\u003ca href= \"https://www.npmjs.com/package/get-ascii-image/v/latest\"\u003e\n\t\t\u003cimg alt=\"npm\" src=\"https://img.shields.io/npm/v/get-ascii-image?style=for-the-badge\"\u003e\n\t\u003c/a\u003e\n\t\u003ca href= \"https://www.npmjs.com/package/get-ascii-image/\"\u003e\n\t\t\u003cimg alt=\"npm Downloads/Week\" src=\"https://img.shields.io/npm/dw/get-ascii-image?style=for-the-badge\"\u003e\n\t\u003c/a\u003e\n\t\u003ca href=\"https://github.com/aromalanil/get-ascii-image/issues\"\u003e\n\t\t\u003cimg alt=\"GitHub issues\" src=\"https://img.shields.io/github/issues/aromalanil/get-ascii-image?style=for-the-badge\"\u003e\n\t\u003c/a\u003e\n\t\u003ca href= \"https://www.npmjs.com/package/get-ascii-image/\"\u003e\n\t\t\u003cimg alt=\"npm bundle size\" src=\"https://img.shields.io/bundlephobia/minzip/get-ascii-image?style=for-the-badge\"\u003e\n\t\u003c/a\u003e\n\t\u003ca href=\"https://github.com/aromalanil/get-ascii-image/blob/master/LICENSE\"\u003e\n\t\t\u003cimg alt=\"GitHub License\" src=\"https://img.shields.io/github/license/aromalanil/get-ascii-image?style=for-the-badge\"\u003e\n\t\u003c/a\u003e\n\t\u003c/div\u003e\n\u003c/div\u003e\n\n\u003cbr/\u003e\n\n\u003e Note : **This is a frontend only package**, As this package uses Canvas API of the DOM.\n\n\u003cbr/\u003e\n\n## 🧰 Installation\n\n### Using npm or yarn 📦\n\n```bash\n# Using npm\nnpm i get-ascii-image\n\n# Using yarn\nyarn add get-ascii-image\n```\n\n### Using CDN ⚡\n\nInclude the js script in your `head` tag as follows:\n\n```html\n\u003cscript src=\"https://unpkg.com/get-ascii-image/index.js\" /\u003e\n```\n\nOr you can download the package from [here](https://github.com/aromalanil/get-ascii-image/archive/master.zip), extract it and include the path to the `index.js` in your `head` tag\n\n```html\n\u003cscript src=\"path/to/get-ascii-image/index.js\" /\u003e\n```\n\n## 🍰 Example\n\n```js\nimport getAsciiImage from \"get-ascii-image\";\n\nconst imageURL = 'https://example.com/image.jpg';\n\nconst config = {\n\tmaxWidth:100,\n\tmaxHeight:300\n};\n\ngetAsciiImage(imageURL,config)\n\t.then(ascii=\u003e{\n\t\tdocument.getElementById('image-container').innerText = ascii;\n\t})\n\t.catch(err=\u003e{\n\t\tconsole.log(err);\n\t}\n});\n```\n\n## 🧵 Syntax\n\n### Using async-await ✋🏻\n\n```js\nimport getAsciiImage from \"get-ascii-image\";\n\nlet asciiImage;\n\n//inside an async function\ntry {\n  //Returns Ascii Image as a string\n  asciiImage = await getAsciiImage(imageSource, config);\n} catch (err) {\n  console.log(err);\n}\n```\n\n### Using Promise 🤝🏻\n\n```js\nimport getAsciiImage from \"get-ascii-image\";\n\nlet asciiImage;\n\ngetAsciiImage(imageSource, config)\n  .then((ascii) =\u003e {\n    asciiImage = ascii;\n  })\n  .catch((err) =\u003e {\n    console.log(err);\n  });\n```\n\n## 🍬 Parameters\n\n- `imageSource` (_String_) : The absolute path to the image source.\n\n- `config` (_Function_) : Optional. An object with 3 values namely `maxWidth` and `maxHeight` and `avoidedCharacters`.\n\n## 🔧 Configuration\n\nPass the configurations to the function using the `config` parameter. The `config` is an object which can contain the following values.\n\n- `maxWidth` (_number_) : Maximum ascii characters in one row of generated Ascii image. Default value is 300\n- `maxHeight` (_number_) : Maximum ascii characters in one column of generated Ascii image . Default value is 500\n- `avoidedCharacters` (_String Array_) : Add all characters you want to avoid in the output, to this array.\n\nHere is an example of a `config` object :\n\n```js\nconst config = {\n  maxWidth: 400,\n  maxHeight: 700,\n  avoidedCharacters: [\"#\", \"a\"],\n};\n```\n\n## 🔗 Miscellaneous\n\n- In case you are taking the image from an external link, make sure the response to the link request contains the header `Access-Control-Allow-Origin: *` in it.\n\n## 📜 License\n\n```\nMIT License\n\nCopyright (c) 2020 Aromal Anil\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n\n## ✍🏻 Author\n\n[Aromal Anil](https://aromalanil.me)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faromalanil%2Fget-ascii-image","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faromalanil%2Fget-ascii-image","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faromalanil%2Fget-ascii-image/lists"}