install prettier-plugin-tailwindcss as a dev dependency
xxxxxxxxxx
npm install -D prettier prettier-plugin-tailwindcss
add the plugin to .prettierrc
xxxxxxxxxx
{
"plugins": ["prettier-plugin-tailwindcss"]
}
xxxxxxxxxx
npm i -D prettier prettier-plugin-tailwindcss
// OR
yarn add -D prettier prettier-plugin-tailwindcss
// .prettierrc
{
"plugins": ["prettier-plugin-tailwindcss"]
}
xxxxxxxxxx
Prettier plugin for tailwind . ( organizes classes in tailwind way )
npm install -D prettier prettier-plugin-tailwindcss
xxxxxxxxxx
yarn add -D prettier prettier-plugin-tailwindcss
//or npm i -D prettier prettier-plugin-tailwindcss
// prettier.config.js
module.exports = {
plugins: ['prettier-plugin-tailwindcss'],
};
if you are using .prettierrc then add in plugin also
{
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"jsxBracketSameLine": false,
"arrowParens": "avoid",
"printWidth": 100,
"plugins": ["prettier-plugin-tailwindcss"],
"overrides": [
{
"files": "*.json",
"options": {
"parser": "json",
"tabWidth": 4
}
},
{
"files": "*.md",
"options": {
"parser": "markdown",
"tabWidth": 4
}
}
]
}
xxxxxxxxxx
// Hash Password
const hashedPassword = await bcrypt.hash(req.body.password, 10)
//compare password
let password = await bcrypt.compare(req.body.password,user.password)
if(!password){
return next(CustomErrorHandler.wrongCredential())
}
xxxxxxxxxx
// npm bcrypt used salt
// code
const bcrypt = require('bcrypt');
// hashing password.(registration)
const hashedPassword = await bcrypt.hash(req.body.password,10);
const user = { name: req.body.username, password: hashedPassword }
// compare password (login)
try {
if (await bcrypt.compare(password, user.password)) {
console.log("login successfull");
} else {
console.log("login failed");
}
} catch (e) {
console.log("something went wrong", error);
}
re.send(user)
xxxxxxxxxx
// Terminal
npm i -D prettier prettier-plugin-tailwindcss
// .prettierrc
{
"plugins": ["prettier-plugin-tailwindcss"]
}
xxxxxxxxxx
const salt = bcrypt.genSaltSync(saltRounds);
const hash = bcrypt.hashSync(myPlaintextPassword, salt);
// Store hash in your password DB.
xxxxxxxxxx
>>> import bcrypt
>>> password = b"super secret password"
>>> # Hash a password for the first time, with a randomly-generated salt
>>> hashed = bcrypt.hashpw(password, bcrypt.gensalt())
>>> # Check that an unhashed password matches one that has previously been
>>> # hashed
>>> if bcrypt.checkpw(password, hashed):
print("It Matches!")
else:
print("It Does not Match :(")
bcrypt password
xxxxxxxxxx
const salt = bcrypt.genSaltSync(saltRounds);
const hash = bcrypt.hashSync(myPlaintextPassword, salt);
// Store hash in your password DB.