Last active
July 18, 2018 08:03
-
-
Save YacheLee/88d8297bebc9235bdcddd625f3972e43 to your computer and use it in GitHub Desktop.
login_ext.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const suppose = require('suppose') | |
, fs = require('fs'); | |
suppose('npm', ['login', '--registry=http://npm.sencha.com', '--scope=@extjs'], {debug: fs.createWriteStream(__dirname+'/debug.txt')}) | |
.when('Username: ' ).respond('{{YOUR_EMAIL}}\n') | |
.when('Password: ' ).respond('{{YOUR_PASSWORD}}\n') | |
.when('Email: (this IS public) ' ).respond('[email protected]\n') | |
.on('error', (err)=>{ | |
console.error(err.message); | |
}) | |
.end(()=>{ | |
const packageFile = '/tmp/awesome/package.json'; | |
fs.readFile(packageFile, ()=>{ | |
console.log("login success"); | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Step1: npm i suppose
Step2: Replace {{YOUR_EMAIL}} with your email
Step3: Replace {{YOUR_PASSWORD}} with your password
Step4: node login_ext.js