How to use the node-pre-gyp/lib/pre-binding.find function in node-pre-gyp

To help you get started, we’ve selected a few node-pre-gyp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github firebase / user-privacy / functions / node_modules / grpc / src / grpc_extension.js View on Github external
* See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

/**
 * @module
 * @private
 */

'use strict';

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

module.exports = binding;
github grpc / grpc-node / packages / grpc-native-core / src / grpc_extension.js View on Github external
* See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

/**
 * @module
 * @private
 */

'use strict';

var binary = require('node-pre-gyp/lib/pre-binding');
var path = require('path');
var binding_path =
    binary.find(path.resolve(path.join(__dirname, '../package.json')));
var binding;
try {
  binding = require(binding_path);
} catch (e) {
  let fs = require('fs');
  let searchPath = path.dirname(path.dirname(binding_path));
  let searchName = path.basename(path.dirname(binding_path));
  let foundNames;
  try {
    foundNames = fs.readdirSync(searchPath);
  } catch (readDirError) {
    let message = `The gRPC binary module was not installed. This may be fixed by running "npm rebuild"
Original error: ${e.message}`;
    let error = new Error(message);
    error.code = e.code;
    throw error;
github grpc / grpc / src / node / src / grpc_extension.js View on Github external
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 */

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

module.exports = binding;

node-pre-gyp

Node.js native addon binary install tool

BSD-3-Clause
Latest version published 4 years ago

Package Health Score

55 / 100
Full package analysis