Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import WebSocket from "ws";
import config from "../../config";
import fs from "fs";
import signale from "signale";
import { search } from "fast-fuzzy";
import fetch from "node-fetch";
import format from "string-template";
signale.config({
displayTimestamp: true,
displayDate: true
});
const log = signale.scope("CHT");
class Chat {
constructor(username, password, channel, obs) {
this.username = username.toLowerCase(); // username
this.password = password; // oauth
this.channel = `#${channel.toLowerCase()}`; // #channel
this.obsProps = obs;
this.obs = obs.obs;
this.prefix = config.twitchChat.prefix;
this.commands = [
"host",
import { createLogger } from '@stoplight/prism-core';
import { IHttpConfig, IHttpProxyConfig, getHttpOperationsFromResource } from '@stoplight/prism-http';
import { createServer as createHttpServer } from '@stoplight/prism-http-server';
import * as chalk from 'chalk';
import * as cluster from 'cluster';
import * as E from 'fp-ts/lib/Either';
import { pipe } from 'fp-ts/lib/pipeable';
import { LogDescriptor, Logger, LoggerOptions } from 'pino';
import * as signale from 'signale';
import * as split from 'split2';
import { PassThrough, Readable } from 'stream';
import { LOG_COLOR_MAP } from '../const/options';
import { createExamplePath } from './paths';
import { attachTagsToParamsValues, transformPathParamsValues } from './colorizer';
signale.config({ displayTimestamp: true });
const cliSpecificLoggerOptions: LoggerOptions = {
customLevels: { start: 11 },
useLevelLabels: true,
level: 'start',
};
async function createMultiProcessPrism(options: CreateBaseServerOptions) {
if (cluster.isMaster) {
cluster.setupMaster({ silent: true });
signale.await({ prefix: chalk.bgWhiteBright.black('[CLI]'), message: 'Starting Prism…' });
const worker = cluster.fork();
if (worker.process.stdout) {
import { noop } from 'lodash'
import signale from 'signale'
import webpack from 'webpack'
import config from '../config/webpack/dev.config'
import * as autoReloading from './auto-reloading'
import * as tasks from './tasks'
signale.config({ displayTimestamp: true })
const triggerReload = process.env.AUTO_RELOAD === 'false' ? noop : autoReloading.initializeServer()
const buildChrome = tasks.buildChrome('dev')
const buildFirefox = tasks.buildFirefox('dev')
tasks.copyAssets('dev')
const compiler = webpack(config)
signale.info('Running webpack')
compiler.hooks.watchRun.tap('Notify', () => signale.await('Compiling...'))
compiler.watch(
{
import OBSWebSocket from "obs-websocket-js";
import fetch from "node-fetch";
import xml2js from "xml2js";
import config from "../../config";
import EventEmitter from "events";
import signale from "signale";
signale.config({
displayTimestamp: true,
displayDate: true
});
const log = signale.scope("OBS");
const parseString = xml2js.parseString;
class ObsSwitcher extends EventEmitter {
constructor(address, password, low, normal, offline, lowBitrateTrigger) {
super();
this.obs = new OBSWebSocket();
this.isLive = false;
this.address = address;
this.password = password;
this.lowBitrateScene = low;
import logger from 'signale';
logger.config({
displayTimestamp: true
});
const methods = ['success', 'start', 'error'] as const;
type Stepper = Pick;
export function getStepper(totalStep: number) {
const stepper = {} as Stepper;
let currentStep = 0;
methods.forEach(key => {
stepper[key] = (message, ...args) => {
const prefix = `[${++currentStep}/${totalStep}] `;
return logger[key](prefix + message, ...args);
};
import WebSocket from "ws";
import signale from "signale";
import events from "../../globalEvents";
signale.config({
displayTimestamp: true,
displayDate: true
});
const log = signale.scope("CHT");
class TwitchConnection {
constructor(username, password) {
this.username = username.toLowerCase();
this.password = password;
this.connected = false;
this.grow = 0;
this.open();
}
'use strict';
const {get} = require('https');
const {blue, green, magenta, red, underline, yellow} = require('chalk');
const signale = require('signale');
const pkg = require('./../package.json');
signale.config({displayLabel: false});
const {fatal, log, note} = signale;
class Rels {
constructor() {
this._latestRelease = {};
this._padding = ' ';
}
get _opts() {
return {
host: 'api.github.com',
headers: {
'user-agent': `${pkg.repository} - ${process.title}`
}
};
'use strict';
const chalk = require('chalk');
const signale = require('signale');
const config = require('./config');
signale.config({displayLabel: false});
const {await: wait, error, log, note, pending, success} = signale;
const {blue, green, grey, magenta, red, underline, yellow} = chalk;
const priorities = {2: 'yellow', 3: 'red'};
class Render {
get _configuration() {
return config.get();
}
_colorBoards(boards) {
return boards.map(x => grey(x)).join(' ');
}
_isBoardComplete(items) {