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

c-wrapper-nodejs-addon

v3.0.0

Published

This is start app setup to start writing c/c++ wrapper as node js add-on to use in nodejs. Aim of this project is to include all dependencies needed to use to write wrapper so that a user can just install it using traditional `npm start` command. And then

Downloads

15

Readme

C-WrapperNodeJSAddon

This package is to make easy sample to setup initial project to start writing C/C++ code wrapper as add-on to use in node JS. It will make easy to install all dependencies just with npm start.

Important note: BASS DLLs used in this project are added just for learning point of view. For Licenses, must contact corresponding forum. http://www.un4seen.com/

1. Prerequisites

nodejs version 8+ must be installed on your system and the below global node packages must be installed:

2. Cloning the repository

Clone the repository:

git clone https://github.com/muhammad-shahzad-anjum/C-WrapperNodeJSAddon.git

3. Installing dependencies

Install dependencies by running the following command: npm install c-wrapper-nodejs-addon (If it does not clone, then download or clone repo as below)

OR

  1. clone to https://github.com/muhammad-shahzad-anjum/C-WrapperNodeJSAddon.git
  2. Install Python 2.7 (v3.x.x is not supported), and run npm config set python python2.7 https://www.python.org/downloads/ Download and install version Python 2.7.14 If you have multiple Python versions installed, you can identify which Python version node-gyp uses by setting the '--python' variable: $ node-gyp --python /path/to/python2.7 If node-gyp is called by way of npm and you have multiple versions of Python installed, then you can set npm's 'python' config key to the appropriate value: $ npm config set python /path/to/executable/python2.7
  3. In console move to project root folder and run

npm install

4. Building the project

Build the project by running the following command: Generate the appropriate project build files for the current platform rebuild -Runs clean, configure and build all in a row

node-gyp rebuild

Command Description help -Shows the help dialog build -Invokes make/msbuild.exe and builds the native addon clean -Removes the build directory if it exists configure -Generates project build files for the current platform rebuild -Runs clean, configure and build all in a row install -Installs node header files for the given version list -Lists the currently installed node header versions remove -Removes the node header files for the given version

build directory will be created during the build

5. Starting the application

Start the application by running the following command:

npm start

The application will be displayed in the browser.

5. Test the application

npm test

The application will be displayed with the result of all test cases.

Resources

How to Create and Publish Your First Node.js Module https://medium.com/@jdaudier/how-to-create-and-publish-your-first-node-js-module-444e7585b738

Note: Update and publish changes in existing package After changing the version number in your package.json, you can run npm publish to publish the new version to NPM.

Node.js v8.7.0 Documentation - C++ Addons https://nodejs.org/api/addons.html

Node.js native addon build tool - node-gyp For wrapper it is must to install node-gyp and pythan https://github.com/nodejs/node-gyp#installation

Microsoft's windows-build-tools For wrapper it is must to install Install all the required tools and configurations using Microsoft's windows-build-tools using npm install --global --production windows-build-tools from an elevated PowerShell or CMD.exe (run as Administrator). https://github.com/nodejs/node-gyp#installation

Install Python 2.7 (v3.x.x is not supported), and run npm config set python python2.7 https://www.python.org/downloads/ Download and install version Python 2.7.14 If you have multiple Python versions installed, you can identify which Python version node-gyp uses by setting the '--python' variable: $ node-gyp --python /path/to/python2.7 If node-gyp is called by way of npm and you have multiple versions of Python installed, then you can set npm's 'python' config key to the appropriate value: $ npm config set python /path/to/executable/python2.7

C++ Wrapper links https://en.wikipedia.org/wiki/Dynamic-link_library#Using_DLL_imports https://stackoverflow.com/questions/10340552/how-to-pass-a-wrapped-c-object-to-a-javascript-callback https://stackoverflow.com/questions/38370023/how-to-add-a-method-to-functionalized-module-exports

BASS DLL download and Documentation http://www.un4seen.com/doc/#bass/BASS_GetVersion.html http://www.un4seen.com/

Node.js Foreign Function Interface - Not used in this project but helping material https://github.com/node-ffi/node-ffi