Skip to content

Instantly share code, notes, and snippets.

View ebrugulec's full-sized avatar
💃

Ebru Gulec ebrugulec

💃
  • Berlin, Germany
View GitHub Profile
{
"presets": ["env", "react"]
}
"main": "dist/index.js",
"scripts": {
...
"transpile": "babel src -d dist --copy-files"
},
"scripts": {
...
"prepublishOnly": "npm run transpile"
},
# .npmignore
src
examples
.babelrc
.gitignore
webpack.config.js
"scripts": {
...
"build": "webpack --mode production",
"deploy": "gh-pages -d examples/dist",
"publish-demo": "npm run build && npm run deploy"
},
module.exports = {
output: {
path: path.join(__dirname, "examples/dist"),
filename: "bundle.js"
},
}
# .gitignore
node_modules
dist
class PasswordGenerator extends Component {
constructor(props){
super(props)
this.state = {
password: '',
length: 12,
digits: 4,
symbols: 2,
copy: false,
strengthScore: 0,
componentDidMount(){
this.generatePassword()
this.checkPasswordStrength()
document.getElementById("copy_btn").addEventListener("click", this.copyToClipboard);
}
componentWillUnmount(){
document.getElementById("copy_btn").removeEventListener("click", this.copyToClipboard);
}