Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'use strict'
const multiaddr = require('multiaddr')
const fs = require('fs-extra')
const merge = require('merge-options').bind({ ignoreUndefined: true })
const debug = require('debug')
const execa = require('execa')
const nanoid = require('nanoid')
const path = require('path')
const os = require('os')
const tempWrite = require('temp-write')
const { checkForRunningApi, repoExists, tmpDir, defaultRepo } = require('./utils')
const daemonLog = {
info: debug('ipfsd-ctl:daemon:stdout'),
err: debug('ipfsd-ctl:daemon:stderr')
}
function translateError (err) {
// get the actual error message to be the err.message
err.message = `${err.stdout} \n\n ${err.stderr} \n\n ${err.message} \n\n`
const { readFileSync, lstatSync } = require('fs');
const { resolve } = require('path');
const merge = require('merge-options').bind({ concatArrays: true });
const nodeVersion = require('node-version');
const weblog = require('webpack-log');
const { load } = require('./config');
const { apply: applyFlags } = require('./flags');
// commented-out properties are there for documentation purposes and to display
// the structure of top-level properties (because reminders are helpful)
const defaults = {
clipboard: true,
compiler: null,
config: {},
content: [],
devMiddleware: { publicPath: '/' },
host: 'localhost',
// hotClient: {},
'use strict'
/* eslint-env browser */
const ky = require('ky-universal').default
const { isBrowser, isWebWorker } = require('ipfs-utils/src/env')
const toUri = require('multiaddr-to-uri')
const errorHandler = require('./error-handler')
const mergeOptions = require('merge-options').bind({ ignoreUndefined: true })
const parseDuration = require('parse-duration')
// Set default configuration and call create function with them
module.exports = create => config => {
config = config || {}
if (typeof config === 'string') {
config = { apiAddr: config }
} else if (config.constructor && config.constructor.isMultiaddr) {
config = { apiAddr: config }
} else {
config = { ...config }
}
config.apiAddr = (config.apiAddr || getDefaultApiAddr(config)).toString()
config.apiAddr = config.apiAddr.startsWith('/') ? toUri(config.apiAddr) : config.apiAddr
#!/usr/bin/env node
/* istanbul ignore next */
if (!module.parent) {
// eslint-disable-next-line global-require
const { register } = require('./global');
register();
}
const { getHelp, getOpts } = require('@webpack-contrib/cli-utils');
const chalk = require('chalk');
const cosmiconfig = require('cosmiconfig');
const debug = require('debug')('webpack-serve');
const meow = require('meow');
const merge = require('merge-options').bind({ concatArrays: true });
const importLocal = require('import-local'); // eslint-disable-line import/order
// Prefer the local installation of webpack-serve
/* istanbul ignore if */
if (importLocal(__filename)) {
debug('Using local install of webpack-serve');
}
const flagSchema = require('../schemas/flags');
const serve = require('./');
// eslint-disable-next-line no-undefined
const flagOptions = { booleanDefault: undefined, flags: getOpts(flagSchema) };
const help = getHelp(flagSchema);
const cli = meow(
'use strict'
const multiaddr = require('multiaddr')
const merge = require('merge-options').bind({ ignoreUndefined: true })
const { repoExists, removeRepo, checkForRunningApi, tmpDir, defaultRepo } = require('./utils')
const debug = require('debug')
const daemonLog = {
info: debug('ipfsd-ctl:proc:stdout'),
err: debug('ipfsd-ctl:proc:stderr')
}
/** @typedef {import("./index").ControllerOptions} ControllerOptions */
/**
* Controller for in process nodes
*/
class InProc {
/**
* @param {ControllerOptions} opts
*/
'use strict'
const multiaddr = require('multiaddr')
const merge = require('merge-options').bind({ ignoreUndefined: true })
const debug = require('debug')
const kyOriginal = require('ky-universal').default
const ky = kyOriginal.extend({ timeout: false })
const daemonLog = {
info: debug('ipfsd-ctl:client:stdout'),
err: debug('ipfsd-ctl:client:stderr')
}
/** @typedef {import("./index").ControllerOptions} ControllerOptions */
/**
* Controller for remote nodes
* @class
*/
class Client {