New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

hyper-folder-icon

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hyper-folder-icon - npm Package Compare versions

Comparing version 1.4.0 to 1.5.0

50

iconfinder.js

@@ -7,3 +7,7 @@ const Icns = require('apple-icns');

const gnomeIcon = require('./gnome');
const _p = require('promisfy');
const exists = _p.promisfyNoError(fs.exists);
const readFile = _p.promisfy(fs.readFile);
const RESOURCEFORK = 'rf';

@@ -46,4 +50,2 @@ const APPFOLDER = 'apf';

}
} else if (!fs.existsSync(folder + '/Icon\r' )) {
this.type = VOLUMEFOLDER;
}

@@ -99,14 +101,38 @@ }

return new Promise((resolve,reject) => {
let file = new resourceFork(this.folder + '/Icon\r');
file.read()
.then(() => {
let buffer = Buffer.from(file.resources['icns'][49081].data.buffer,260);
let icon = new Icns(buffer);
let _findIcon = (folder) => new Promise(async (resolve,reject) => {
iconReading(icon)
.then((ret) => resolve(ret))
.catch((err) => reject(err));
})
.catch((error) => reject(error));
while (!await exists(folder + '/Icon\r')) {
folder = folder.split('/').slice(0,-1).join('/');
if (folder == "") {
break;
}
}
if (folder == "") {
const data = await readFile('/.VolumeIcon.icns').catch(err => reject(err));
let icon = new Icns(data);
const ret = iconReading(icon).catch(err => reject(err));
resolve(ret);
} else {
let file = new resourceFork(folder + '/Icon\r');
try {
await file.read();
let buffer = Buffer.from(file.resources['icns'][49081].data.buffer,260);
let icon = new Icns(buffer);
const ret = await iconReading(icon);
resolve(ret);
} catch (error) {
reject(error);
}
}
});
_findIcon(this.folder.slice())
.then(ret => resolve(ret))
.catch(error => reject(error));
});

@@ -113,0 +139,0 @@ break;

{
"name": "hyper-folder-icon",
"version": "1.4.0",
"version": "1.5.0",
"description": "Use folder icons in MacOS and Windows with Hyper",

@@ -32,4 +32,5 @@ "main": "./index.js",

"plist": "^3.0.1",
"promisfy": "^1.1.4",
"resourceforkjs": "0.0.4"
}
}

@@ -13,3 +13,4 @@ hyper-folder-icon

- Show icon of current folder if custom icon has been applied to the folder
- Show Volume icon of the HD if the folder does not have a custom icon
- <=1.4.0: ~~Show Volume icon of the HD if the folder does not have a custom icon~~
- ^1.5.0 Show icon of any of the parent folders. If there is no, show the Volume icon.
- Show Volume icon of additional Volumes if a custom icon has been applied to the Volume

@@ -19,3 +20,3 @@ - Show App icon if inside of the .app folder

- Integrates with hyper-tab-touchbar showing the icons in the MacBook Pro's TouchBar
- Integrates with [hyper-tab-touchbar](https://github.com/moimart/hyper-tab-touchbar) showing the icons in the MacBook Pro's TouchBar

@@ -22,0 +23,0 @@ ![hyper-tab-touchbar integration](https://i.imgur.com/2pnvB1w.jpg)

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