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

clean-publish

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clean-publish - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

CHANGELOG.md

47

clean-publish.js
#!/usr/bin/env node
var fs = require('fs');
var fse = require('fs-extra');
var CONFIG_FILES_LIST = require('./config-files-list');
const fs = require('fs');
const fse = require('fs-extra');
const omit = require('lodash.omit');
const {
spawn,
execSync,
} = require('child_process');
(function() {
var tmp = './tmp';
fs.mkdirSync(tmp);
fs.readdirSync('./').forEach(function(i) {
if (i !== 'tmp') {
if (CONFIG_FILES_LIST.indexOf(i) == -1 || fs.statSync(i).isDirectory()) {
fse.copy(i, `${tmp}/${i}`);
const IGNORE_FILES = require('./ignore-files');
const IGNORE_FIELDS = require('./ignore-fields');
(function () {
const tmp = fs.mkdtempSync('tmp');
const src = './'
const packageJSON = 'package.json'
fs.readdirSync(src).forEach(i => {
if (i !== tmp) {
if (IGNORE_FILES.indexOf(i) == -1 || fs.statSync(i).isDirectory()) {
fse.copy(i, `${tmp}/${i}`)
.then(() => {
if (i === packageJSON) {
fse.readJson(packageJSON, (err, obj) => {
fse.writeJsonSync(`./${tmp}/${packageJSON}`, omit(obj, IGNORE_FIELDS), {
spaces: 2
})
})
}
});
}
}
})
process.chdir(tmp);
const publish = spawn('npm', ['publish'], {
stdio: 'inherit'
});
})();
publish.on('exit', () => {
fse.removeSync(tmp);
})
process.chdir('../');
})();
{
"name": "clean-publish",
"version": "1.0.1",
"version": "1.0.2",
"description": "Clean your package before publish",

@@ -24,4 +24,5 @@ "keywords": [

"dependencies": {
"fs-extra": "^6.0.1"
"fs-extra": "^6.0.1",
"lodash.omit": "^4.5.0"
}
}
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