mapbox / mapbox/node-pre-gyp

Separate lib/pre-binding.js into its own npm module?

Open
#191 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.2k
Forks
271
Avg merge
23h 40m
Merged PRs (30d)
2

Description

This is just a thought, so please bear with me here...

node-pre-gyp's dependencies have rather large file sizes (i.e. request weighs 2.6MB), and node-pre-gyp weights over 4MB! For this reason, I'd like to bundle my pre-compiled module into a nice, small tarball that doesn't need node-pre-gyp as a dependency; however, I like that node-pre-gyp replaces the npm bindings module with the following code:

``` javascript
var binary = require('node-pre-gyp');
var path = require('path');
var binding_path = binary.find(path.resolve(path.join(__dirname,'./package.json')));
var binding = require(binding_path);
```

Is there any way that the functionality of `lib/pre-binding.js` could be separated into another npm module that is required by node-pre-gyp? That way, I could easily delete node-pre-gyp as a dependency after building/installation and still have the binding path determined dynamically.

Does that make sense? Thoughts on this?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing lib/pre-binding.js and the package.json-based binding lookup shown in the issue, then trace how node-pre-gyp exposes that functionality. Determine whether extracting it into a separate npm module is viable and define the module boundary, dependency behavior, and compatibility expectations. Done means the proposal has a decided scope and an implementation path.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.