electron-named-image
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
473613
75