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 🙏

© 2025 – Pkg Stats / Ryan Hefner

edge-reference

v1.0.0

Published

Allows references to be transferred between node.js and .NET applications.

Downloads

8

Readme

edge-reference

A node.js package and associated .NET components that allow JavaScript code to create, access, and maintain references to live .NET objects.

This package contains the functionality required to access .NET using proxies generated by the related edge-generator package.

Installation

$ npm i edge-reference -S

Usage

.NET code is accessed by proxies generated by the edge-generator module. Visit the edge-generator documentation for instructions on generating proxies.

A generated proxy closely resembles its .NET source, and can be imported using its file name:

const Widget = require('./proxies/ExampleCo-Utils-Widget.js');

Constructors

A constructor for a new object is called in the same way as any JavaScript constructor would be:

var instance = new Widget();

At this time, only parameterless constructors are supported.

If for some reason a separate copy of an object is desired, the constructor can be passed a value representing the underlying .NET object associated with an instance:

var secondInstance = new Widget(instance._referenceId);

Properties

Properties are accessed synchronously, and so closely resemble .NET property access:

// Member is a string property in the Widget class
var result = instance.Member;

// StatMember is a static property of the Widget class
var staticResult = Widget.StatMember;

// Setting a property with a public access modifier is also possible:
instance.Member = "newvalue";

// Complex properties can also be read and assigned
var relatedWidget = new Widget();
instance.Sibling = relatedWidget;

Functions

Unlike properties, functions are accesssed asynchronously. This is done by appending a standard node.js-style callback to a function's arguments, as shown below:

var instance = new Widget();

// A function that takes two arguments and returns a string
instance.MemberFunction(arg1, arg2, (err, result) => {
	// At this time, the function is complete
	if (err) {
		console.error('Error');
		return;
	}

	console.log('return value is ' + result);
});

As with properties, non-primitive types can be used, both as arguments and return values:

var instance = new Widget();
var second = new Widget();

// A function that compares two Widget instances and returns one or the other
instance.compareAndReturn(second, (err, result) => {
	if (err) {
		console.error('Error');
		return;
	}

	console.log('Is instance returned?');
	console.log(instance.referenceEquals(result) ? 'yes' : 'no');
});

Built-in Members

Proxies to .NET objects contain a few members by default. These members should not be overridden by .NET code.

View the edge-reference API reference for details.

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