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

@erhhung/node-resource-hacker

v1.0.1

Published

Async Node.js wrapper for Resource Hacker v5.1.6+

Downloads

732

Readme

node-resource-hacker

Simple Node.js wrapper around the Resource Hacker application for Windows. Unlike other wrappers that don't seem to be actively maintained, this one has an async interface, and, most importantly, conforms to the new command-line format of Resource Hacker v5.1.6 from July 2018.

Install

$ npm install @erhhung/node-resource-hacker --save-dev

This wrapper is written using async/await support in ES8, and will require Node.js 8.0 at a minimum.

Upon first usage, this module will download "resource_hacker.zip" from www.angusj.com, the official and only website were Resource Hacker is distributed. It will then extract a single file, "ResourceHacker.exe", and place it into "node_modules\.bin".

Make sure your network proxy environment variable http_proxy is already set, if necessary.

Usage

import hacker from '@erhhung/node-resource-hacker';

async function setIcon() {
  try {
    await hacker({
      action:   'addoverwrite', // required
      open:     'bin\app.exe',  // required
      save:     'bin\app.exe',  // optional (default: .open)
      resource: 'res\app.ico',  // optional
      mask: {                   // optional
        type: 'ICONGROUP',
        name: '1',              // optional
        lang: '',               // optional
      },
    });
  } catch (err) {
    console.error(err);
  }
}

See the Command-Line Syntax section of Resource Hacker for details on available actions and mask values. This wrapper automatically adds the -log NUL option to suppress application output.

Pkg

This module was originally written to patch Windows executables generated by the pkg tool so one doesn't have to be stuck with the default node.exe icon. If you have the same use case, simply adapt the example above in your build script, and follow these tips:

  • Run Resource Hacker only on the output of pkg.
  • Make sure your resource .ico file has the exact same set of icon sizes (16x16, 32x32, 48x48, 64x64, 128x128) as the node.exe template or else the patched .exe will be corrupt! You can use an online tool like ICO Convert to convert from a PNG.
  • Make sure the mask type is ICONGROUP, and the mask name is 1.

License

MIT