├── .github └── FUNDING.yml ├── .gitignore ├── CONTRIBUTING.md ├── DOCUMENTATION.md ├── LICENSE ├── README.md ├── bin └── namly ├── example └── index.js ├── lib └── index.js └── package.json /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: ionicabizau 2 | patreon: ionicabizau 3 | open_collective: ionicabizau 4 | custom: https://www.buymeacoffee.com/h96wwchmy -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | *.swo 3 | *~ 4 | *.log 5 | node_modules 6 | *.env 7 | .DS_Store 8 | package-lock.json 9 | .bloggify/* 10 | -------------------------------------------------------------------------------- /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 -------------------------------------------------------------------------------- /DOCUMENTATION.md: -------------------------------------------------------------------------------- 1 | ## Documentation 2 | 3 | You can see below the API reference of this module. 4 | 5 | ### `namly(name, callback)` 6 | Generates a set of names using [`name-it`](https://github.com/IonicaBizau/name-it) 7 | and checks if they are available on the NPM registry using 8 | [`npm-available-array](http://github.com/IonicaBizau/npm-available-array). 9 | 10 | #### Params 11 | 12 | - **String** `name`: A keyword to use for generating names. 13 | - **Function** `callback`: The callback function. 14 | 15 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015-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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | # `$ namly` 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/namly.svg)](https://www.npmjs.com/package/namly) [![Downloads](https://img.shields.io/npm/dt/namly.svg)](https://www.npmjs.com/package/namly) [![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 | > A tool for helping you to choose npm package names. 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | [![namly](http://i.imgur.com/zI93Tlz.png)](#) 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | ## :cloud: Installation 53 | 54 | You can install the package globally and use it as command line tool: 55 | 56 | 57 | ```sh 58 | # Using npm 59 | npm install --global namly 60 | 61 | # Using yarn 62 | yarn global add namly 63 | ``` 64 | 65 | 66 | Then, run `namly --help` and see what the CLI tool can do. 67 | 68 | 69 | ``` 70 | $ namly --help 71 | Usage: namly [options] 72 | 73 | Options: 74 | -i, --input The package keyword. 75 | -h, --help Displays this help. 76 | -v, --version Displays version information. 77 | 78 | Examples: 79 | namly -i name 80 | 81 | Documentation can be found at https://github.com/IonicaBizau/namly#readme 82 | ``` 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | ## :clipboard: Example 97 | 98 | 99 | 100 | Here is an example how to use this package as library. To install it locally, as library, you can use `npm install namly` (or `yarn add namly`): 101 | 102 | 103 | 104 | ```js 105 | const namly = require("namly"); 106 | 107 | // Generate a couple of package names related to "name" 108 | namly("name", (err, data) => { 109 | console.log(err || data); 110 | // => 111 | // [ { name: 'namy', available: false }, 112 | // { name: 'namer', available: false }, 113 | // { name: 'name2', available: true }, 114 | // { name: 'namify', available: false }, 115 | // { name: 'name-it', available: false }, 116 | // { name: 'name.js', available: true }, 117 | // { name: 'namous', available: true }, 118 | // { name: 'namly', available: true }, 119 | // { name: 'namance', available: true }, 120 | // { name: 'namoid', available: true }, 121 | // { name: 'namient', available: true }, 122 | // { name: 'nament', available: true }, 123 | // { name: 'namonin', available: true }, 124 | // { name: 'namoxin', available: true }, 125 | // { name: 'namo', available: true } ] 126 | }); 127 | ``` 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | ## :question: Get Help 141 | 142 | There are few ways to get help: 143 | 144 | 145 | 146 | 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. 147 | 2. For bug reports and feature requests, open issues. :bug: 148 | 3. For direct and quick help, you can [use Codementor](https://www.codementor.io/johnnyb). :rocket: 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | ## :memo: Documentation 157 | 158 | For full API reference, see the [DOCUMENTATION.md][docs] file. 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | ## :yum: How to contribute 172 | Have an idea? Found a bug? See [how to contribute][contributing]. 173 | 174 | 175 | ## :sparkling_heart: Support my projects 176 | I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously, 177 | 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). 178 | 179 | 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: 180 | 181 | 182 | - Starring and sharing the projects you like :rocket: 183 | - [![Buy me a book][badge_amazon]][amazon]—I love books! I will remember you after years if you buy me one. :grin: :book: 184 | - [![PayPal][badge_paypal]][paypal-donations]—You can make one-time donations via PayPal. I'll probably buy a ~~coffee~~ tea. :tea: 185 | - [![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). 186 | - **Bitcoin**—You can send me bitcoins at this address (or scanning the code below): `1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6` 187 | 188 | ![](https://i.imgur.com/z6OQI95.png) 189 | 190 | 191 | Thanks! :heart: 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | ## :scroll: License 217 | 218 | [MIT][license] © [Ionică Bizău][website] 219 | 220 | 221 | 222 | 223 | 224 | 225 | [license]: /LICENSE 226 | [website]: https://ionicabizau.net 227 | [contributing]: /CONTRIBUTING.md 228 | [docs]: /DOCUMENTATION.md 229 | [badge_patreon]: https://ionicabizau.github.io/badges/patreon.svg 230 | [badge_amazon]: https://ionicabizau.github.io/badges/amazon.svg 231 | [badge_paypal]: https://ionicabizau.github.io/badges/paypal.svg 232 | [badge_paypal_donate]: https://ionicabizau.github.io/badges/paypal_donate.svg 233 | [patreon]: https://www.patreon.com/ionicabizau 234 | [amazon]: http://amzn.eu/hRo9sIZ 235 | [paypal-donations]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RVXDDLKKLQRJW 236 | -------------------------------------------------------------------------------- /bin/namly: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | // Dependencies 4 | const namly = require("../lib") 5 | , log = require("emoji-logger") 6 | , clp = require("clp") 7 | , package = require("../package") 8 | ; 9 | 10 | log.add( 11 | "available" 12 | , "whiteCheckMark" 13 | , "turquoise" 14 | ); 15 | 16 | log.add( 17 | "unavailable" 18 | , "noEntry" 19 | , "carrot" 20 | ); 21 | 22 | log.add( 23 | "loading" 24 | , "hourglassFlowingSand" 25 | , "concrete" 26 | , 1 27 | ); 28 | 29 | // Parse the command line arguments 30 | var inputOpt = new clp.Option(["i", "input"], "The package keyword.", "keyword") 31 | , parser = new clp({ 32 | name: "Namly" 33 | , version: package.version 34 | , exe: package.name 35 | , examples: [ 36 | "namly -i name" 37 | ] 38 | , docs_url: package.homepage 39 | , process: true 40 | }, [ 41 | inputOpt 42 | ]) 43 | ; 44 | 45 | inputOpt.value = (inputOpt.value || "").trim(); 46 | if (!inputOpt.value) { 47 | return log("The input keyword is mandatory.", "error"); 48 | } 49 | 50 | log("Fetching the data... This may take a while.", "loading"); 51 | namly(inputOpt.value, (err, data) => { 52 | if (err) { 53 | if (Array.isArray(err)) { 54 | return err.forEach(c => c && log(c.toString(), "error")); 55 | } 56 | return log(err.message, "error"); 57 | } 58 | data.forEach(c => log(c.name, c.available ? "available" : "unavailable")); 59 | }); 60 | -------------------------------------------------------------------------------- /example/index.js: -------------------------------------------------------------------------------- 1 | const namly = require("../lib"); 2 | 3 | // Generate a couple of package names related to "name" 4 | namly("name", (err, data) => { 5 | console.log(err || data); 6 | // => 7 | // [ { name: 'namy', available: false }, 8 | // { name: 'namer', available: false }, 9 | // { name: 'name2', available: true }, 10 | // { name: 'namify', available: false }, 11 | // { name: 'name-it', available: false }, 12 | // { name: 'name.js', available: true }, 13 | // { name: 'namous', available: true }, 14 | // { name: 'namly', available: true }, 15 | // { name: 'namance', available: true }, 16 | // { name: 'namoid', available: true }, 17 | // { name: 'namient', available: true }, 18 | // { name: 'nament', available: true }, 19 | // { name: 'namonin', available: true }, 20 | // { name: 'namoxin', available: true }, 21 | // { name: 'namo', available: true } ] 22 | }); 23 | -------------------------------------------------------------------------------- /lib/index.js: -------------------------------------------------------------------------------- 1 | const nameIt = require("name-it") 2 | , available = require("npm-available-array") 3 | ; 4 | 5 | /** 6 | * namly 7 | * Generates a set of names using [`name-it`](https://github.com/IonicaBizau/name-it) 8 | * and checks if they are available on the NPM registry using 9 | * [`npm-available-array](http://github.com/IonicaBizau/npm-available-array). 10 | * 11 | * @name namly 12 | * @function 13 | * @param {String} name A keyword to use for generating names. 14 | * @param {Function} callback The callback function. 15 | */ 16 | function namly(name, callback) { 17 | available( 18 | nameIt(name)._.concat(name) 19 | , callback 20 | ); 21 | } 22 | 23 | module.exports = namly; 24 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "namly", 3 | "version": "1.2.10", 4 | "description": "A tool for helping you to choose npm package names.", 5 | "main": "lib/index.js", 6 | "bin": { 7 | "namly": "./bin/namly" 8 | }, 9 | "scripts": { 10 | "test": "echo \"Error: no test specified\" && exit 1" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git+ssh://git@github.com/IonicaBizau/namly.git" 15 | }, 16 | "keywords": [ 17 | "name", 18 | "generate", 19 | "npm", 20 | "available" 21 | ], 22 | "author": "Ionică Bizău (https://ionicabizau.net)", 23 | "contributors": [ 24 | "Daniel Hug (http://www.hugwebdesign.com/)" 25 | ], 26 | "license": "MIT", 27 | "bugs": { 28 | "url": "https://github.com/IonicaBizau/namly/issues" 29 | }, 30 | "homepage": "https://github.com/IonicaBizau/namly#readme", 31 | "dependencies": { 32 | "clp": "^3.2.0", 33 | "emoji-logger": "^1.0.0", 34 | "name-it": "^1.3.0", 35 | "npm-available-array": "^1.0.0" 36 | }, 37 | "blah": { 38 | "ex_img": "http://i.imgur.com/zI93Tlz.png" 39 | }, 40 | "files": [ 41 | "bin/", 42 | "app/", 43 | "lib/", 44 | "dist/", 45 | "src/", 46 | "scripts/", 47 | "resources/", 48 | "menu/", 49 | "cli.js", 50 | "index.js", 51 | "index.d.ts", 52 | "package-lock.json", 53 | "bloggify.js", 54 | "bloggify.json", 55 | "bloggify/" 56 | ] 57 | } --------------------------------------------------------------------------------