What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-01-28 20:55:32
npm node env
$ npm install dotenv //-------------------- on file .env //-------------------- DB_HOST=localhost DB_USER=root DB_PASS=s1mpl3 DB_NAME=banco_de_dados DB_PORT=3306 //-------------------- import the config from .env file //-------------------- require... Add solution -
Javascript 2022-01-28 06:20:36
node import all functions from file
//we are in ./utils/dbHelper.js, here we have some helper functions function connect() { // connect do db... } function closeConnection() { // close connection to DB... } //let's export this function to show them to the world outside module.exports ... Add solution -
Javascript 2022-01-26 05:55:20
node module export multiple functions
//Inside lib file declare functions const animalName = (name) => { console.log(name) } const animalSound = (sound) => { console.log(sound) } //Export these both as JSON module.exports = {animalName, animalSound} //Navigate to file you want to use... Add solution -
CSS 2022-01-24 05:55:02
mini-css-extract-plugin sass
//installation npm install --save-dev mini-css-extract-plugin //configuration const MiniCssExtractPlugin = require('mini-css-extract-plugin'); module.exports = { plugins: [new MiniCssExtractPlugin()], module: { rules: [ { test: /\.... Add solution -
Javascript 2022-01-22 18:36:33
java script member count embed
Const { MessageEmbed } = require('discord.js') module.exports = { name: 'stats', description: 'Display info about this server.', execute(message) { const embed = new MessageEmbed() .setColor('RANDOM') .setTitle(`Title Display Her... Add solution -
Shell/Bash 2022-01-22 04:45:27
how to use dotenv in javascript
$ npm install dotenv //-------------------- on file .env //-------------------- DB_HOST=localhost DB_USER=root DB_PASS=s1mpl3 DB_NAME=banco_de_dados DB_PORT=3306 //-------------------- import the config from .env file //-------------------- require... Add solution -
Javascript 2021-12-23 16:40:11
laravel vuejs assets()
//Inside the head section of the layout create a global reference //to the base asset path, something like this window._asset = '{{ asset('') }}'; //Next step is to create a Vue mixin. In my case, a trans.js file with the following content: module.expor... Add solution