Socket
Socket
Sign inDemoInstall

@newrelic/native-metrics

Package Overview
Dependencies
75
Maintainers
2
Versions
36
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 7.0.2 to 7.1.0

11

CHANGELOG.md

@@ -0,1 +1,12 @@

### v7.1.0 (2022-01-11)
* Added ability to download pre-builts through a proxy host.
* Use `NR_NATIVE_METRICS_PROXY_HOST=<proxy_host> npm i @newrelic/native-metrics`.
* Fixed deprecated code, updated `fs.existsSync` to `fs.accessSync` and using `NULL` vs. the more modern `nullptr`.
* Added workflow to automate preparing release notes by reusing the newrelic/node-newrelic/.github/workflows/prep-release.yml@main workflow from agent repository.
* Added job to automatically add issues/pr to Node.js Engineering board
### v7.0.2 (2021-08-26):

@@ -2,0 +13,0 @@ * Updated code to only check `node-gyp` version when the module needs to be built to avoid hanging node and subsequently causing OOM errors.

43

lib/pre-build.js

@@ -24,2 +24,3 @@ /*

const zlib = require('zlib')
const ProxyAgent = require('proxy-agent')
const {

@@ -99,5 +100,4 @@ getBinFileName,

gypPath = process.env.npm_config_node_gyp
if (fs.existsSync(gypPath)) {
return gypPath
}
fs.accessSync(gypPath)
return gypPath
} catch (err) {

@@ -113,5 +113,4 @@ // This method failed, hopefully the next will succeed...

gypPath = path.resolve(gypPkgPath, '../../bin/node-gyp.js')
if (fs.existsSync(gypPath)) {
return gypPath
}
fs.accessSync(gypPath)
return gypPath
} catch (err) {

@@ -126,5 +125,4 @@ // This method failed, hopefully the next will succeed...

gypPath = path.resolve(npmPkgPath, '../../node_modules/node-gyp/bin/node-gyp.js')
if (fs.existsSync(gypPath)) {
return gypPath
}
fs.accessSync(gypPath)
return gypPath
} catch (err) {

@@ -137,7 +135,8 @@ // This method failed, hopefully the next will succeed...

gypPath = path.join(nodeNpmPkgPath, 'node_modules/node-gyp/bin/node-gyp.js')
if (fs.existsSync(gypPath)) {
try {
fs.accessSync(gypPath)
return gypPath
} catch {
return null
}
return null
}

@@ -219,11 +218,21 @@

let hasCalledBack = false
let options = {}
if (DOWNLOAD_HOST.startsWith('https:')) {
client = https
if (process.env.NR_NATIVE_METRICS_PROXY_HOST) {
const proxy = process.env.NR_NATIVE_METRICS_PROXY_HOST
options.host = new URL(DOWNLOAD_HOST).host
options.path = REMOTE_PATH + fileName
options.agent = new ProxyAgent(proxy)
client = /^https:/.test(proxy) ? https : http
} else {
console.log('Falling back to http, please consider enabling SSL on ' + DOWNLOAD_HOST)
client = http
options = url
if (DOWNLOAD_HOST.startsWith('https:')) {
client = https
} else {
console.log('Falling back to http, please consider enabling SSL on ' + DOWNLOAD_HOST)
client = http
}
}
client.get(url, function getFile(res) {
client.get(options, function getFile(res) {
if (res.statusCode === 404) {

@@ -230,0 +239,0 @@ return cb(new Error('No pre-built artifacts for your OS/architecture.'))

{
"name": "@newrelic/native-metrics",
"version": "7.0.2",
"version": "7.1.0",
"description": "A module for generating metrics from V8.",

@@ -99,2 +99,3 @@ "main": "index.js",

"nan": "^2.14.2",
"proxy-agent": "^5.0.0",
"semver": "^5.5.1"

@@ -101,0 +102,0 @@ },

@@ -65,2 +65,10 @@ [![Community Plus header](https://github.com/newrelic/opensource-website/raw/master/src/images/categories/Community_Plus.png)](https://opensource.newrelic.com/oss-category/#community-plus)

You can also specify a proxy host to route requests through using the `NR_NATIVE_METRICS_PROXY_HOST` environment variable:
```sh
$ export NR_NATIVE_METRICS_NO_BUILD=true
$ export NR_NATIVE_METRICS_PROXY_HOST=http://your-proxy-host/
$ npm install @newrelic/native-metrics
```
For more information, please see the agent [installation guide][install-node] and [compatibility and requirements][compatibility].

@@ -174,2 +182,2 @@

[install-node]: https://docs.newrelic.com/docs/agents/nodejs-agent/installation-configuration/install-nodejs-agent
[compatibility]: https://docs.newrelic.com/docs/agents/nodejs-agent/getting-started/compatibility-requirements-nodejs-agent
[compatibility]: https://docs.newrelic.com/docs/agents/nodejs-agent/getting-started/compatibility-requirements-nodejs-agent

@@ -18,2 +18,3 @@ # Third Party Notices

* [nan](#nan)
* [proxy-agent](#proxy-agent)
* [semver](#semver)

@@ -64,2 +65,18 @@

### proxy-agent
This product includes source derived from [proxy-agent](https://github.com/TooTallNate/node-proxy-agent) ([v5.0.0](https://github.com/TooTallNate/node-proxy-agent/tree/v5.0.0)), distributed under the [MIT License](https://github.com/TooTallNate/node-proxy-agent/blob/v5.0.0/README.md):
```
MIT License
Copyright (c) <year> <copyright holders>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
```
### semver

@@ -66,0 +83,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc