
Research
PyPI Package Disguised as Instagram Growth Tool Harvests User Credentials
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
mac-file-icon
Advanced tools
Get the native macOS icon for a specific file extension as a PNG image buffer.
Inspired and based on:
Retrieves icon, exactly the same way as Finder does it, including QuickLook preview generation in case if it's possible, just check out the example at the end of this page. My motivation to write this module was impossiblity to obtain file system's entry icon in Electron, there is simply no method to do that.
npm install mac-file-icon
var getIconForFile = require('mac-file-icon');
getIconForFile('/Users/', function(buffer) {
console.info(buffer);
});
You can always convert Buffer into it's base64 representation:
var getIconForFile = require('mac-file-icon');
getIconForFile('/Users/', function(buffer) {
console.info(buffer.toString('base64'));
});
In case if callback is ommited, Buffer will be returned in synchronous way:
var getIconForFile = require('mac-file-icon');
console.info(getIconForFile('/Users/'));
By default, icon size is set to 32x32, you can adjust it by passing additional argument:
var getIconForFile = require('mac-file-icon');
// icon size 64x64
getIconForFile('/Users/', function(buffer) {
console.info(buffer);
}, 64);
Works same way in synchronous calls:
var getIconForFile = require('mac-file-icon');
// icon size 64x64
console.info(getIconForFile('/Users/', 64));
cd macIconForFile
npm install
node-gyp configure
node-gyp build
However I'm not sure if last two statements are required...
You can try out an example included into the package, that uses Express, Histone and macIconForFile to generate file listing in the browser.
npm install mac-file-icon
cd node_modules/mac-file-icon/example
npm install
node index.js
Then open your web browser and navigate to http://localhost:8080/ (in case if this port number is taken, edit index.js and set another one), you will see something like this:
FAQs
Get the Finder icon for a file path
The npm package mac-file-icon receives a total of 0 weekly downloads. As such, mac-file-icon popularity was classified as not popular.
We found that mac-file-icon demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.