Skip to content

Instantly share code, notes, and snippets.

@YacheLee
Last active July 18, 2018 08:03
Show Gist options
  • Save YacheLee/88d8297bebc9235bdcddd625f3972e43 to your computer and use it in GitHub Desktop.
Save YacheLee/88d8297bebc9235bdcddd625f3972e43 to your computer and use it in GitHub Desktop.
login_ext.js
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");
})
});
@YacheLee
Copy link
Author

YacheLee commented Jul 18, 2018

Step1: npm i suppose
Step2: Replace {{YOUR_EMAIL}} with your email
Step3: Replace {{YOUR_PASSWORD}} with your password
Step4: node login_ext.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment