Skip to content

lukehoban/node-uwp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-uwp

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

Example

var uwp = require('uwp');
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

Currently building node.js native addon modules on Windows with Chakra depends on Node.js build. See building native addon modules with Chakra.

node.exe [node_repo]\deps\npm\bin\npm-cli.js install uwp --nodedir=[node_repo] --msvs_version=2015

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.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 72.3%
  • JavaScript 25.3%
  • Python 2.4%