New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

haraka-net-utils

Package Overview
Dependencies
Maintainers
4
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

haraka-net-utils - npm Package Compare versions

Comparing version 1.4.0 to 1.4.1

5

Changes.md
#### N.N.N - YYYY-MM-DD
### [1.4.1] - 2022-07-22
### [1.4.0] - 2022-07-22
- feat(get_mx): use async/await

@@ -181,2 +180,2 @@ - feat(get_mx): call w/o callback for promise API

[1.3.7]: https://github.com/haraka/haraka-net-utils/releases/tag/1.3.7
[1.4.0]: https://github.com/haraka/haraka-net-utils/releases/tag/1.4.0
[1.4.1]: https://github.com/haraka/haraka-net-utils/releases/tag/1.4.1

12

index.js

@@ -340,11 +340,9 @@ 'use strict';

// for callback API
if (done) {
if (done) { // legacy callback API
Promise.all(promises).then((r) => { done(errors, Array.from(ips)) })
return
}
// promise API
// if (process.env.DEBUG && errors.length) console.error(errors)
return Promise.all(promises).then(r => { return Array.from(ips) })
else { // promise API
// if (process.env.DEBUG && errors.length) console.error(errors)
return Promise.all(promises).then(r => { return Array.from(ips) })
}
}

@@ -351,0 +349,0 @@

{
"name": "haraka-net-utils",
"version": "1.4.0",
"version": "1.4.1",
"description": "haraka network utilities",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -95,11 +95,30 @@ [![CI][ci-img]][ci-url]

### get_ips_by_host
Returns an array of all the IPv4 and IPv6 addresses of the provided hostname.
```js
try {
const ips = await net_utils.get_ips_by_host(domain)
for (const ip of ips) {
// do something with the IPs
}
}
catch (err) {
// handle any errors
}
```
### get_mx
```js
net_utils.get_mx(domain, (err, mxList) => {
if (err) // handle any errors
try {
const mxList = await net_utils.get_mx(domain)
for (const mx of mxList) {
// do something with each mx
}
})
}
catch (err) {
// handle any errors
}
```

@@ -106,0 +125,0 @@

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc