Tag: javascript

  • Discord.js Bot Starter Template

    This code will run a basic discord bot that you can split into commands and then keep everything organized in modules. Files: package.json index.js .env src/commands/index.js src/commands/ping.js (a sample command) You can add new commands in src/commands/ folder by copying the sample.js file and modifying it to suit your module. Then you have to edit […]

  • JavaScript Cheatsheet

    ForEach loop in javascript: Export & Import modules in JavaScript ES6 (node / react / nextjs) We can export multiple items from a single file in javascript ES6 module. Check following examples, all can happen in one file. Note that we also have one default export, also one “as” export (see below on how to […]