├── lib └── index.js ├── DOCUMENTATION.md ├── .gitignore ├── .github └── FUNDING.yml ├── LICENSE ├── bin └── image-to-ascii ├── package.json ├── CONTRIBUTING.md └── README.md /lib/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require("image-to-ascii"); 2 | -------------------------------------------------------------------------------- /DOCUMENTATION.md: -------------------------------------------------------------------------------- 1 | ## Documentation 2 | 3 | You can see below the API reference of this module. 4 | 5 | ### exports 6 | 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | *.swo 3 | *~ 4 | *.log 5 | node_modules 6 | *.env 7 | .DS_Store 8 | package-lock.json 9 | .bloggify/* 10 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: ionicabizau 2 | patreon: ionicabizau 3 | open_collective: ionicabizau 4 | custom: https://www.buymeacoffee.com/h96wwchmy -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016-25 Ionică Bizău (https://ionicabizau.net) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /bin/image-to-ascii: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | // Dependencies 4 | var ImageToAscii = require("image-to-ascii") 5 | , Abs = require("abs") 6 | , Logger = require("bug-killer") 7 | , CLP = require("clp") 8 | , Package = require("../package") 9 | , IsThere = require("is-there") 10 | ; 11 | 12 | // Parse the command line arguments 13 | var imgOpt = new CLP.Option(["i", "img"], "Image path", "path") 14 | , parser = new CLP({ 15 | name: "CLI Image Viwer" 16 | , version: Package.version 17 | , exe: Package.name 18 | , examples: [ 19 | "image-to-ascii -i path/to/some/image.png" 20 | ] 21 | , docs_url: Package.homapage 22 | , process: true 23 | }, [ 24 | imgOpt 25 | ]) 26 | , options = null 27 | ; 28 | 29 | if (!imgOpt.is_provided) { 30 | return console.log(parser.displayHelp()); 31 | } 32 | 33 | if (!/^https?:\/\//.test(imgOpt.value)) { 34 | imgOpt.value = Abs(imgOpt.value); 35 | if (!IsThere(imgOpt.value)) { 36 | return Logger.log(new Error("The image does not exist.")); 37 | } 38 | } 39 | 40 | ImageToAscii(imgOpt.value, function(err, converted) { 41 | if (err) { return Logger.log(err, "error"); } 42 | console.log(converted); 43 | }); 44 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "image-to-ascii-cli", 3 | "version": "1.0.12", 4 | "description": "View images in text format, in your terminal.", 5 | "main": "lib/index.js", 6 | "bin": { 7 | "image-to-ascii": "./bin/image-to-ascii" 8 | }, 9 | "dependencies": { 10 | "abs": "^1.2.1", 11 | "bug-killer": "^4.2.1", 12 | "clp": "^3.2.1", 13 | "image-to-ascii": "^3.0.8", 14 | "is-there": "^4.3.1" 15 | }, 16 | "devDependencies": {}, 17 | "scripts": { 18 | "test": "echo \"Error: no test specified\" && exit 1" 19 | }, 20 | "author": "Ionică Bizău (https://ionicabizau.net)", 21 | "license": "MIT", 22 | "repository": { 23 | "type": "git", 24 | "url": "git+ssh://git@github.com/IonicaBizau/image-to-ascii-cli.git" 25 | }, 26 | "bugs": { 27 | "url": "https://github.com/IonicaBizau/image-to-ascii-cli/issues" 28 | }, 29 | "homepage": "https://github.com/IonicaBizau/image-to-ascii-cli#readme", 30 | "blah": { 31 | "api": "image-to-ascii" 32 | }, 33 | "files": [ 34 | "bin/", 35 | "app/", 36 | "lib/", 37 | "dist/", 38 | "src/", 39 | "scripts/", 40 | "resources/", 41 | "menu/", 42 | "cli.js", 43 | "index.js", 44 | "index.d.ts", 45 | "package-lock.json", 46 | "bloggify.js", 47 | "bloggify.json", 48 | "bloggify/" 49 | ] 50 | } -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # 🌟 Contributing 2 | 3 | Want to contribute to this project? Great! Please read these quick steps to streamline the process and avoid unnecessary tasks. ✨ 4 | 5 | ## 💬 Discuss Changes 6 | Start by opening an issue in the repository using the [bug tracker][1]. Describe your proposed contribution or the bug you've found. If relevant, include platform info and screenshots. 🖼️ 7 | 8 | Wait for feedback before proceeding unless the fix is straightforward, like a typo. 📝 9 | 10 | ## 🔧 Fixing Issues 11 | 12 | Fork the project and create a branch for your fix, naming it `some-great-feature` or `some-issue-fix`. Commit changes while following the [code style][2]. If the project has tests, add one. ✅ 13 | 14 | If a `package.json` or `bower.json` exists, add yourself to the `contributors` array; create it if it doesn't. 🙌 15 | 16 | ```json 17 | { 18 | "contributors": [ 19 | "Your Name (http://your.website)" 20 | ] 21 | } 22 | ``` 23 | 24 | ## 📬 Creating a Pull Request 25 | Open a pull request and reference the initial issue (e.g., *fixes #*). Provide a clear title and consider adding visual aids for clarity. 📊 26 | 27 | ## ⏳ Wait for Feedback 28 | Your contributions will be reviewed. If feedback is given, update your branch as needed, and the pull request will auto-update. 🔄 29 | 30 | ## 🎉 Everyone Is Happy! 31 | Your contributions will be merged, and everyone will appreciate your effort! 😄❤️ 32 | 33 | Thanks! 🤩 34 | 35 | [1]: /issues 36 | [2]: https://github.com/IonicaBizau/code-style -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | # `$ image-to-ascii` 21 | 22 | [![Support me on Patreon][badge_patreon]][patreon] [![Buy me a book][badge_amazon]][amazon] [![PayPal][badge_paypal_donate]][paypal-donations] [![Ask me anything](https://img.shields.io/badge/ask%20me-anything-1abc9c.svg)](https://github.com/IonicaBizau/ama) [![Version](https://img.shields.io/npm/v/image-to-ascii-cli.svg)](https://www.npmjs.com/package/image-to-ascii-cli) [![Downloads](https://img.shields.io/npm/dt/image-to-ascii-cli.svg)](https://www.npmjs.com/package/image-to-ascii-cli) [![Get help on Codementor](https://cdn.codementor.io/badges/get_help_github.svg)](https://www.codementor.io/@johnnyb?utm_source=github&utm_medium=button&utm_term=johnnyb&utm_campaign=github) 23 | 24 | Buy Me A Coffee 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | > View images in text format, in your terminal. 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | ## :cloud: Installation 51 | 52 | You can install the package globally and use it as command line tool: 53 | 54 | 55 | ```sh 56 | # Using npm 57 | npm install --global image-to-ascii-cli 58 | 59 | # Using yarn 60 | yarn global add image-to-ascii-cli 61 | ``` 62 | 63 | :bulb: **ProTip**: If you want to use this package as module, check out [`image-to-ascii`—the API version of it](https://github.com/IonicaBizau/image-to-ascii). 64 | 65 | 66 | 67 | Then, run `image-to-ascii --help` and see what the CLI tool can do. 68 | 69 | 70 | ``` 71 | $ image-to-ascii --help 72 | Usage: image-to-ascii-cli [options] 73 | 74 | Options: 75 | -i, --img Image path 76 | -h, --help Displays this help. 77 | -v, --version Displays version information. 78 | 79 | Examples: 80 | image-to-ascii -i path/to/some/image.png 81 | 82 | 83 | ``` 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | ## :question: Get Help 108 | 109 | There are few ways to get help: 110 | 111 | 112 | 113 | 1. Please [post questions on Stack Overflow](https://stackoverflow.com/questions/ask). You can open issues with questions, as long you add a link to your Stack Overflow question. 114 | 2. For bug reports and feature requests, open issues. :bug: 115 | 3. For direct and quick help, you can [use Codementor](https://www.codementor.io/johnnyb). :rocket: 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | ## :memo: Documentation 124 | 125 | For full API reference, see the [DOCUMENTATION.md][docs] file. 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | ## :yum: How to contribute 139 | Have an idea? Found a bug? See [how to contribute][contributing]. 140 | 141 | 142 | ## :sparkling_heart: Support my projects 143 | I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously, 144 | this takes time. You can integrate and use these projects in your applications *for free*! You can even change the source code and redistribute (even resell it). 145 | 146 | However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it: 147 | 148 | 149 | - Starring and sharing the projects you like :rocket: 150 | - [![Buy me a book][badge_amazon]][amazon]—I love books! I will remember you after years if you buy me one. :grin: :book: 151 | - [![PayPal][badge_paypal]][paypal-donations]—You can make one-time donations via PayPal. I'll probably buy a ~~coffee~~ tea. :tea: 152 | - [![Support me on Patreon][badge_patreon]][patreon]—Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone). 153 | - **Bitcoin**—You can send me bitcoins at this address (or scanning the code below): `1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6` 154 | 155 | ![](https://i.imgur.com/z6OQI95.png) 156 | 157 | 158 | Thanks! :heart: 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | ## :scroll: License 184 | 185 | [MIT][license] © [Ionică Bizău][website] 186 | 187 | 188 | 189 | 190 | 191 | 192 | [license]: /LICENSE 193 | [website]: https://ionicabizau.net 194 | [contributing]: /CONTRIBUTING.md 195 | [docs]: /DOCUMENTATION.md 196 | [badge_patreon]: https://ionicabizau.github.io/badges/patreon.svg 197 | [badge_amazon]: https://ionicabizau.github.io/badges/amazon.svg 198 | [badge_paypal]: https://ionicabizau.github.io/badges/paypal.svg 199 | [badge_paypal_donate]: https://ionicabizau.github.io/badges/paypal_donate.svg 200 | [patreon]: https://www.patreon.com/ionicabizau 201 | [amazon]: http://amzn.eu/hRo9sIZ 202 | [paypal-donations]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RVXDDLKKLQRJW 203 | --------------------------------------------------------------------------------