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

fast-folder-size

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fast-folder-size - npm Package Compare versions

Comparing version 1.7.1 to 2.0.0

.github/dependabot.yml

44

get-sysinternals-du.js

@@ -0,4 +1,6 @@

const fs = require('fs')
const os = require('os')
const https = require('https')
const path = require('path')
const unzipper = require('unzipper')
const decompress = require('decompress')

@@ -10,2 +12,11 @@ // Only run for Windows

// check if du is already installed
if (
fs.existsSync(
path.join(__dirname, 'bin', `du${process.arch === 'x64' ? '64' : ''}.exe`)
)
) {
process.exit(0)
}
const duZipLocation =

@@ -15,4 +26,33 @@ process.env.FAST_FOLDER_SIZE_DU_ZIP_LOCATION ||

// checks for proxy variables in user environment
const proxyAddress =
process.env.HTTPS_PROXY ||
process.env.https_proxy ||
process.env.HTTP_PROXY ||
process.env.http_proxy
if (proxyAddress) {
const proxyOptions = new URL(proxyAddress)
const agent = new https.Agent({
proxy: {
host: proxyOptions.hostname,
port: proxyOptions.port || 8080,
protocol: proxyOptions.protocol,
auth: proxyOptions.auth,
},
})
https.globalAgent = agent
}
https.get(duZipLocation, function (res) {
res.pipe(unzipper.Extract({ path: path.join(__dirname, 'bin') }))
const tempFilePath = path.join(os.tmpdir(), 'du.zip')
const fileStream = fs.createWriteStream(tempFilePath)
res.pipe(fileStream)
fileStream.on('finish', function () {
fileStream.close()
decompress(tempFilePath, path.join(__dirname, 'bin'))
})
})

2

os.js

@@ -8,3 +8,3 @@ const path = require('path')

'bin',
'du.exe'
`du${process.arch === 'x64' ? '64' : ''}.exe`
)}" -nobanner -accepteula -q -c .`,

@@ -11,0 +11,0 @@

{
"name": "fast-folder-size",
"version": "1.7.1",
"version": "2.0.0",
"description": "Node CLI or module to calculate folder size",

@@ -26,13 +26,13 @@ "main": "index.js",

"dependencies": {
"unzipper": "^0.10.11"
"decompress": "^4.2.1"
},
"devDependencies": {
"@types/node": "^15.6.1",
"eslint": "^7.21.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.0",
"prettier": "^2.2.1",
"tap": "^15.0.1",
"tsd": "^0.16.0"
"@types/node": "^20.2.5",
"eslint": "^8.41.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1",
"prettier": "^2.8.8",
"tap": "^16.3.4",
"tsd": "^0.28.1"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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