Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@crypticat/cli

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@crypticat/cli - npm Package Compare versions

Comparing version 0.1.5 to 0.2.0

4

lib/cli.js

@@ -9,4 +9,4 @@ var __importStar = (this && this.__importStar) || function (mod) {

const [_, ...args] = process.argv;
if (args[0] === 'server') {
Promise.resolve().then(() => __importStar(require('./server')));
if (args[1] === 'serve') {
Promise.resolve().then(() => __importStar(require('./server'))).then(({ go }) => go(parseInt(args[2]) || 8080));
}

@@ -13,0 +13,0 @@ else {

@@ -19,2 +19,4 @@ "use strict";

const chalk_1 = __importDefault(require("chalk"));
const conf_1 = __importDefault(require("conf"));
const config = new conf_1.default();
const rl = readline_promise_1.default.createInterface({

@@ -63,4 +65,11 @@ input: process.stdin,

print(chalk_1.default.green('Connection established!'));
print('');
yield joinRoom('lobby');
let nick = 'unknown';
let nick = config.get('nickname', null);
if (nick) {
print(`Your nickname is currently ${chalk_1.default.cyan(nick)}`);
}
else {
print(`Please set a nickname with \`${chalk_1.default.cyan('/nick <nickname>')}\``);
}
while (true) {

@@ -81,2 +90,3 @@ const message = yield input();

}
print('');
const room = args[0].startsWith('#') ? args[0].slice(1) : args[0];

@@ -88,6 +98,10 @@ yield joinRoom(room);

if (!args[0]) {
nick = 'unknown';
nick = null;
config.delete('nickname');
print(chalk_1.default.green('Reset nickname'));
break;
}
nick = args.join(' ');
config.set('nickname', nick);
print(chalk_1.default.green(`Updated nickname to ${nick}`));
break;

@@ -98,5 +112,5 @@ }

}
client.sendMessage(nick, message);
client.sendMessage(nick !== null && nick !== void 0 ? nick : 'unnicked', message);
}
});
//# sourceMappingURL=client.js.map

@@ -1,1 +0,1 @@

export {};
export declare const go: (port: number) => void;

@@ -13,3 +13,7 @@ "use strict";

server.on('dispatch', (from, to) => console.log(`${from.slice(0, 6)} ${chalk_1.default.gray('->')} ${to.slice(0, 6)}`));
server.listen(8080);
exports.go = (port) => {
console.log(chalk_1.default.green(`Started server on port ${port}`));
console.log(`Connect with \`${chalk_1.default.cyan(`crypticat ws://localhost:${port}`)}\``);
server.listen(8080);
};
//# sourceMappingURL=server.js.map
{
"name": "@crypticat/cli",
"version": "0.1.5",
"version": "0.2.0",
"description": "Crypticat's command-line interface",

@@ -24,12 +24,17 @@ "author": "Kognise <felix.mattick@gmail.com>",

"scripts": {
"tsc": "tsc -p tsconfig.build.json"
"tsc": "tsc -p tsconfig.build.json",
"watch": "tsc --watch"
},
"dependencies": {
"@crypticat/core": "^0.1.4",
"chalk": "^3.0.0",
"readline-promise": "^1.0.4"
"conf": "^6.2.1",
"readline-promise": "^1.0.4",
"typescript": "^3.8.3"
},
"devDependencies": {
"@types/node": "^13.9.5",
"typescript": "^3.8.3"
},
"gitHead": "4c752e81d310236b3a0b5acf1c4c5d39eb3c6e62"
"gitHead": "611a587b42e6320bcfa7afca71062b24d9d46994"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc