Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
getEnvs () {
const { path, silent, safe } = this.config
const env = dotenv.parse(this.loadFile({
file: path,
silent
}), this.getDefaults())
let blueprint = env
if (safe) {
let file = './.env.example'
if (safe !== true) {
file = safe
}
blueprint = dotenv.parse(this.loadFile({
file,
silent
}))
}
getEnvs () {
const { path, silent, safe } = this.config
const env = dotenv.parse(this.loadFile({
file: path,
silent
}), this.getDefaults())
let blueprint = env
if (safe) {
let file = './.env.example'
if (safe !== true) {
file = safe
}
blueprint = dotenv.parse(this.loadFile({
file,
silent
}))
}
return {
env,
blueprint
}
}
require('dotenv-defaults').config()
const semver = require('semver')
const axios = require('axios')
const fetch = require('node-fetch')
const pacote = require('pacote')
const Queue = require('../server/Queue')
const CustomError = require('../server/CustomError')
/**
* Given a package string
* this function resolves to a valid version and name.
*/
async function resolvePackage(packageString) {
try {
return await pacote.manifest(packageString, { 'full-metadata': true })
} catch (err) {
require('dotenv-defaults').config()
const debug = require('debug')('bp:cache')
const axios = require('axios')
const logger = require('../server/Logger')
const API = axios.create({
baseURL: process.env.CACHE_SERVICE_ENDPOINT,
timeout: 5000,
});
class Cache {
async getPackageSize({ name, version }) {
debug('get package %s@%s', name, version)
try {
const result = await API.get('/package-cache', { params: { name, version } })
debug('cache hit')
return result.data
require('dotenv-defaults').config()
const firebase = require('firebase')
const LRU = require('lru-cache')
const debug = require('debug')('bp:cache')
const fastify = require('fastify')()
const { getPackageSizeMiddlware, postPackageSizeMiddlware } = require('./middlewares/package-size.middleware')
const { getExportsSizeMiddlware, postExportsSizeMiddleware } = require('./middlewares/exports-size.middleware')
const firebaseConfig = {
apiKey: process.env.FIREBASE_API_KEY,
authDomain: process.env.FIREBASE_AUTH_DOMAIN,
databaseURL: process.env.FIREBASE_DATABASE_URL,
}
firebase.initializeApp(firebaseConfig)
const { blackList } = require("../server/config");
require('dotenv-defaults').config()
const firebase = require('firebase')
const axios = require('axios')
const fetch = require('node-fetch')
const fs = require('fs')
const path = require('path')
const Queue = require('promise-queue-plus')
const debug = require('debug')('rebuild:script')
const debugWarning = require('debug')('rebuild:warning')
const got = require('got')
const gitURLParse = require('git-url-parse')
const { resolvePackage } = require("./server.utils");
const { parsePackageString } = require("./common.utils");
const deepEqual = require('lodash.isequal')
const childProcess = require('child_process')
const mkdir = require('mkdir-promise')