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

electron-named-image

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

electron-named-image - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

4

package.json
{
"name": "electron-named-image",
"version": "1.0.1",
"version": "1.0.2",
"description": "Node.js bridge to Objective-C [NSImage imageNamed]. Simplifies using default macOS images in Electron apps.",

@@ -9,2 +9,4 @@ "main": "index.js",

"test-electron": "electron test/electron-test.js",
"test-node": "node test/node-test.js",
"compile-for-node": "node-gyp rebuild -d",
"compile-for-electron": "HOME=~/.electron-gyp node-gyp rebuild -d --target=1.6.7 --arch=x64 --dist-url=https://atom.io/download/electron",

@@ -11,0 +13,0 @@ "get-images": "node bin/generate-images"

@@ -10,2 +10,4 @@ # electron-named-image

Most likely you'll want to add it to your `optionalDependencies` due to the way that npm handles platform specific native addons. This way `npm install` won't fail on non-macOS platforms.
## What? Why?

@@ -58,2 +60,13 @@

If you specify an invalid named image or are using it on a macOS version that pre-dates `NSTouchBar*` icons, you'll get back an empty buffer. For example:
```javascript
namedImage.getImageNamed('invalid').length // => 0
namedImage.getImageNamed('NSTrashFull').length // => 9166
```
The empty buffer will work as expected with Electron's `nativeImage` module, you just won't have any actual image.
All of the `NSTouchBar*` named images have been outputted as PNGs to the `images` folder which you can use as well just by manually saving and importing them into your app.
## Compiling for use in an Electron app

@@ -60,0 +73,0 @@ See [https://github.com/electron/electron/blob/master/docs/tutorial/using-native-node-modules.md] for the easy, right way. Or you can also `npm install -g node-gyp` and then run the same `compile-for-electron` script I have in the package.json in the root of this module's folder.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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