How to use the @imgcook/cli-utils.homedir function in @imgcook/cli-utils

To help you get started, we’ve selected a few @imgcook/cli-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github imgcook / imgcook-cli / packages / @imgcook / cli / lib / helper.js View on Github external
const request = require('request');
const fs = require('fs');
const chalk = require('chalk');
const ora = require('ora');
const childProcess = require('child_process');

const spinner = ora();
const domain = 'https://www.imgcook.com';

const { homedir } = require('@imgcook/cli-utils');
const userhome = homedir();
const imgcookConfigPath = `${userhome}/.imgcook`;
const imgcookRc = `${imgcookConfigPath}/.imgcookrc`;
const imgcookModules = `${imgcookConfigPath}/imgcook_modules`;
const cliConfig = {
  path: imgcookConfigPath,
  configFile: imgcookRc,
  imgcookModules,
  module: {
    url: `${domain}/api-open/code-acquire`
  }
};

// Post request
const ajaxPost = (url, param) => {
  return new Promise(resolve => {
    request.post(

@imgcook/cli-utils

imgcook cli utils

MIT
Latest version published 3 years ago

Package Health Score

43 / 100
Full package analysis

Similar packages