npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

edge-generator

v1.0.0

Published

Generates JavaScript proxies of .NET code that allow references to be passed between node.js and .NET libraries.

Downloads

2

Readme

edge-generator

A node.js package that generates proxies which hold references to live .NET objects in JavaScript code.

While this package generates proxies, the related edge-reference package is used at runtime to bind the proxies to their .NET counterparts. Therefore, edge-reference should be installed as a runtime dependency of any module which uses proxies generated by this package.

Installation

$ npm i edge-generator -g

or to install in the current project only:

$ npm i edge-generator --save-dev

Usage

edge-generator -a <assembly-path> [-t <target-directory>] Namespace.Type1 Namespace.Type2

A proxy will be generated for each type specified in the arguments passed to the utility. These types must be contained in the assembly that is located at the path specified in . Besides each type, a proxy will be generated for its base type and any non-primitive types referenced in its public members.

Generation of a proxy will generate a JS file with a name corresponding to the fully-qualified type name. These files will be written to the target directory specified, or to the current directory if no target directory is given.

Example

The following example:

edge-generator -a ./bin/Debug/ExampleCo.Utils.dll -t ./proxies ExampleCo.Utils.Connector ExampleCo.Utils.Widget ExampleCo.Utils.Factory

will generate three JavaScript files in the ./proxies directory, assuming the DLL specified exists, and contains the three types named. The files generated will be named

ExampleCo-Utils-Connector.js

ExampleCo-Utils-Widget.js

ExampleCo-Utils-Factory.js

It is possible to rename generated files after generation.

When deploying proxy files, the .NET assemblies referenced by them must also be deployed, in the node project's root folder. It is also necessary to install and save the edge-reference node module.

Notable Limitations

Several features of the .NET framework and the C# language are not supported at this time. A non-exhaustive list is below:

  • Constructor parameters - At the moment, only parameterless constructors are supported.
  • Overloaded members - Due to limitations of the JavaScript language, overloading is not directly possible in these proxies. Solutions are being investigated.
  • Generics - generic parameters are not supported at this time, and generated proxies will generally not function correctly when calling generic methods.
  • out/ref parameters - There is currently no support for this feature. Since JavaScript does not support two-way arguments, there will never be full support without additional data structures.
  • optional arguments - Generated proxies receive a callback as the last argument. For this reason, default values should be explicitly supplied for optional arguments.
  • User-defined value types - currently, only reference types and primitives are supported.

Disclaimer

The author of this package is in no way affiliated with the edge.js package.

Dedication

Dedicated to Dorothy Gant (1925-2017)

License

Copyright (c) 2017 Steve Westbrook

MIT