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

gypjs

v0.0.1

Published

Build tool for C/C++

Downloads

3

Readme

gyp.js

Node.js native addon build tool

gyp.js is a fork for node-gyp a cross-platform command-line tool written in Node.js for compiling native addon modules for Node.js.

The goal of gyp.js is provide an easy-to-use build tool for C/C++ developers for various platforms.

Features:

  • Easy to use, consistent interface
  • Same commands to build your module on every platform

Installation

You can install with npm:

$ npm install -g gypjs

You will also need to install:

  • On Unix:
    • python (v2.7 recommended, v3.x.x is not supported)
    • make
    • A proper C/C++ compiler toolchain, like GCC
  • On Windows:
    • [Python][windows-python] ([v2.7.3][windows-python-v2.7.3] recommended, v3.x.x is not supported)
    • Windows XP/Vista/7:
      • Microsoft Visual Studio C++ 2010 ([Express][msvc2010] version works well)
      • For 64-bit builds of node and native modules you will also need the [Windows 7 64-bit SDK][win7sdk]
        • If the install fails, try uninstalling any C++ 2010 x64&x86 Redistributable that you have installed first.
      • If you get errors that the 64-bit compilers are not installed you may also need the [compiler update for the Windows SDK 7.1]
    • Windows 7/8:
      • Microsoft Visual Studio C++ 2012 for Windows Desktop ([Express][msvc2012] version works well)

If you have multiple Python versions installed, you can identify which Python version gyp.js uses by setting the '--python' variable:

$ gypjs --python /path/to/python2.7

If gyp.js 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

Note that OS X is just a flavour of Unix and so needs python, make, and C/C++. An easy way to obtain these is to install XCode from Apple, and then use it to install the command line tools (under Preferences -> Downloads).

Examples

Hello world!

Let's make a "Hello world!" executable console in C and build it. Write a package.gyp file with this content:

{
	'targets': [
		{
			'target_name': 'hello',
			'type': 'executable',
				'sources': [
					'hello.c',
				],
		},
	],
}

Write a hello.c file with this content:

#include <stdio.h>

int main(void)
{
	printf("Hello, world!\n");
	return 0;
}

The next step is to generate the appropriate project build files for the current platform. Use configure for that:

$ gypjs configure

Note: The configure step looks for the package.gyp file in the current directory to processs. See below for instructions on creating the package.gyp file.

Now you will have either a Makefile (on Unix platforms) or a vcxproj file (on Windows) in the build/ directory. Next invoke the build command:

$ gypjs build

Now, you can find our executable file in build/Release/.