Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

archive-tool

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

archive-tool - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

.npmignore

35

lib/index.js

@@ -11,2 +11,3 @@ 'use strict';

const co = require('co');
const merge = require('lodash.merge');
const formatDate = require('date-fns/format');

@@ -17,3 +18,3 @@ const install = require('nodeinstall').install;

constructor(config = {}) {
this.config = {
this.config = merge({
cwd: process.cwd(),

@@ -26,5 +27,4 @@ format: 'zip', // support zip or tar

installDeps: false,
archive: {},
...config
};
archive: {}
}, config);
}

@@ -57,11 +57,10 @@

const cwd = target || this.config.target;
const installNode = { ...this.config.installNode, ...options };
const installNode = merge(this.config.installNode, options);
return co(function *() {
return yield install({
return yield install(merge({
cwd,
version: '^8.10.0',
cache: true,
china: true,
...installNode
});
china: true
}, installNode));
});

@@ -71,9 +70,8 @@ }

installDeps(target, options) {
const { cwd, mode, registry } = {
const installDeps = merge(this.config.installDeps, options);
const { cwd, mode, registry } = merge({
cwd: target || this.config.target,
mode: 'npm',
registry: 'https://registry.npm.taobao.org',
...this.config.installDeps,
...options
};
registry: 'https://registry.npm.taobao.org'
}, installDeps);
console.log(chalk.green(`------ start ${mode} install --production dependencies ------ `));

@@ -98,3 +96,3 @@ const cmdArgs = [`${mode} install --production`];

console.log(chalk.green(`------ start create ${archiveFormat} file ------`));
const archive = { ...this.config.archive, ...options };
const archive = merge(this.config.archive, options);
const ac = archiver(archiveFormat, archive);

@@ -117,6 +115,5 @@ const output = fs.createWriteStream(target);

create(options, callback) {
const { cwd, filename, source, installDeps, installNode, format } = {
...this.config,
...options
};
const _options = merge(this.config, options);
const { cwd, filename, source, installDeps, installNode, format } = merge({
}, _options);
const archiveDir = path.join(this.config.target, filename);

@@ -123,0 +120,0 @@ const ext = EXT[format];

{
"name": "archive-tool",
"version": "1.0.0",
"version": "1.0.1",
"description": "archive files to zip/tar",

@@ -16,2 +16,3 @@ "keywords": [

"fs-extra": "^5.0.0",
"lodash.merge": "^4.6.1",
"nodeinstall": "^0.1.3",

@@ -18,0 +19,0 @@ "shelljs": "^0.8.1"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc