How to use the coinstac-client-core.getDefaultAppDirectory function in coinstac-client-core

To help you get started, we’ve selected a few coinstac-client-core 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 trendscenter / coinstac / packages / coinstac-ui / scripts / clean.js View on Github external
'use strict';

const pify = require('util').promisify;
const CoinstacClient = require('coinstac-client-core');
const rimraf = require('rimraf');

const dir = CoinstacClient.getDefaultAppDirectory();

/* eslint-disable no-console */
console.log(`Removing ${dir} …`);

pify(rimraf)(dir)
  .then(() => console.log('Removed!'))
  .catch(console.error);
/* eslint-enable no-console */
github trendscenter / coinstac / packages / coinstac-ui / scripts / clean-db.js View on Github external
'use strict';

// find ~/.coinstac/* ! -name computations -maxdepth 0 -exec rm -rf '{}' \\;

const pify = require('util').promisify;
const CoinstacClient = require('coinstac-client-core');
const compact = require('lodash/compact');
const fs = require('fs');
const path = require('path');
const rimraf = require('rimraf');

const dir = CoinstacClient.getDefaultAppDirectory();
const rimrafAsync = pify(rimraf);
const statAsync = pify(fs.stat);

/* eslint-disable no-console */
console.log('Removing local dbs…');

pify(fs.readdir)(dir)
  .then(files => Promise.all(files.map((file) => {
    const fullPath = path.join(dir, file);

    return statAsync(fullPath).then((stats) => {
      return stats.isDirectory() && file !== 'computations'
        ? fullPath
        : undefined;
    });
  })))

coinstac-client-core

COINSTAC business logic for clients.

MIT
Latest version published 1 month ago

Package Health Score

73 / 100
Full package analysis