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

@novastar/native

v2.0.0-alpha.11

Published

Structures and APIs in typescript automatically generated from decompiled NovaStar .NET libraries

Downloads

133

Readme

@novastar/native

Structures and APIs in typescript automatically generated from decompiled NovaStar .NET libraries.

Go to API documentation.

Installation

Using npm:

$ npm install --save @novastar/native@next

or yarn:

$ yarn add @novastar/native@next

Usage

Since the native API contains more than 1000 methods, not all of which you will use, you can include the methods you need. To do this, create a file api.ts and import the functionality you need.

// api.ts

import '@novastar/native/api/ReadDviMode';
import '@novastar/native/api/ReadDviSelect';
import '@novastar/native/api/ReadGlobalBrightness';
import '@novastar/native/api/ReadIsHasDVI';
import '@novastar/native/api/ReadAllBrightnessInfo';
import '@novastar/native/api/ReadSelfTestMode';
import '@novastar/native/api/SetGlobalBrightness';
import '@novastar/native/api/SetSelfTestMode';
import '@novastar/native/api/SetGamma';
import '@novastar/native/api/ReadGamma';
import '@novastar/native/api/ReadScanner_McuProgramRemarks';
import '@novastar/native/api/ReadScanner_FPGAProgramRemarks';

Each import adds new methods to the Session class and extends API interface. If you import the file MethodName, then the async methods MethodName and tryMethodName will be added. The first method for reading the value will return a promise with a non-negative number if the response has a buffer size of 1, 2, or 4 bytes and a promise with a buffer otherwise. If the response is not received, or the status of the response contains an error, an exception will be rejected. The second method, which starts with try, will return the answer, or null if there is none. In this case, don't forget to check the status res.ack of the response .

Then create a Session.ts file that will export the resulting type containing all of your selected methods.

// Session.ts

import { API, Session } from '@novastar/codec';

import './api';

export type SessionAPI = API & Session;

export type { API };

Now you can use the resulting type:

import net from '@novastar/net';
import { SessionAPI } from './Session';

const session: SessionAPI = net.open('192.168.1.40');
await session.SetGamma(0, 0, 0, false, 2.6);

Structs and enumerations are also best imported via direct paths.

Enum types end with Enum in their names. Each file contains, in addition to the type, a codec that can be used to validate and convert input data. See io-ts for details.

Troubleshooting

Not all APIs have been automatically converted from decompiled code. In addition, the resulting code may contain errors. There is also no description of API, and we can only guess about its purpose based on its name. Unfortunately, many names may contain syntax and semantic errors (original names are preserved). Refer to the decompiled code if in doubt.

Important note

This repository only contains C# scripts, some wrapping for the generated API, and the original binary libraries. All useful content is automatically generated from the decompiled code of binary libraries. You will either have to do it yourself according to the supplied instructions, or use a @novastar/native package. A description of the generated API is also available here.

Development

Install dependencies

# npm
npm install
# yarn
yarn install

To decompile binary libraries, dotnet version 5 or higher is required, and the ilspycmd package must also be installed.

To check the prerequisites, run the command

# npm
npm run requirements
# yarn
yarn run requirements

To install ilspycmd run the command:

# npm
npm run ilspycmd:install
# yarn
yarn run ilspycmd:install

To automatically generate the typescript code, run the command:

# npm
npm run gen
# yarn
yarn run gen