Enables Universal Windows Platform (UWP) API access for Node.js (Chakra build) on Windows 10.
Перейти к файлу
microsoft-github-policy-service[bot] cbb40f3193
Auto merge mandatory file pr
This pr is auto merged as it contains a mandatory file and is opened for more than 10 days.
2023-06-27 13:09:24 +00:00
src Removing tab 2015-10-15 18:52:32 -07:00
test augment projectNamespace to return namespace 2016-07-29 16:51:33 -07:00
.gitignore remove checked-in nan, minor cleanup 2015-05-29 09:48:21 -07:00
LICENSE initial package 2015-05-11 11:06:07 -07:00
README.md augment projectNamespace to return namespace 2016-07-29 16:51:33 -07:00
SECURITY.md Microsoft mandatory file 2023-06-12 19:02:12 +00:00
binding.gyp initial package 2015-05-11 11:06:07 -07:00
index.js augment projectNamespace to return namespace 2016-07-29 16:51:33 -07:00
package.json 1.0.2 2016-09-29 14:51:44 -07:00

README.md

node-uwp

Enables Universal Windows Platform (UWP) API access for Node.js (Chakra build) on Windows 10.

Example

const uwp = require('uwp');
const Windows = uwp.projectNamespace('Windows');

Windows.Storage.KnownFolders.documentsLibrary.createFileAsync(
  'sample.dat', Windows.Storage.CreationCollisionOption.replaceExisting)
  .done(
    function (file) {
      console.log('ok');
      uwp.close(); // all async operations are completed, release uwp
    },
    function (error) {
      console.error('error', error);
      uwp.close(); // all async operations are completed, release uwp
    }
);

Installation

Prerequisites

Run under Node.js (Chakra) command prompt:

npm install uwp

APIs

This package exports 2 functions.

projectNamespace(name)

Project a UWP namespace of given name.

  • Note: This function will keep Node process alive so that your app can continue to run and handle UWP async callbacks. You need to call close() when UWP usage is completed.

close()

Close all UWP handles used by this package. Call this when all UWP usage is completed.


Checkout our OSS effort with Node-ChakraCore. It supports the most recent version of node.js and will also be useful if you are on Windows 7 or Windows 8.1. Note: It does not support UWP.