Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ipv4

Package Overview
Dependencies
Maintainers
3
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ipv4 - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

test/mocha.opts

2

index.js

@@ -0,1 +1,3 @@

'use strict';
module.exports = require('./lib/ipv4');

16

lib/ipv4.js
'use strict';
var network = require('os').networkInterfaces();
for (var n in network) {
var ipv4 = network[n].filter(function(i) {
return i.family === 'IPv4' && !i.internal;
});
if (ipv4.length) {
module.exports = ipv4[0].address;
return;
}
}
// Fallback
module.exports = '0.0.0.0';
module.exports = require('address').ip();
{
"name": "ipv4",
"version": "1.0.1",
"version": "1.0.2",
"description": "ipv4",

@@ -18,7 +18,11 @@ "bin": {

"devDependencies": {
"mocha": "*"
"mocha": "*",
"validator": "^9.2.0"
},
"homepage": "https://github.com/xudafeng/ipv4",
"scripts": {
"test": "mocha"
},
"license": "MIT",
"dependencies": {
"address": "^1.0.3",
"chalk": "^1.1.3",

@@ -25,0 +29,0 @@ "copy-paste": "^1.3.0"

@@ -1,19 +0,11 @@

/* ================================================================
* ipv4 by xdf(xudafeng[at]126.com)
*
* first created at : Wed Jun 04 2014 12:33:02 GMT+0800 (CST)
*
* ================================================================
* Copyright 2013 xdf
*
* Licensed under the MIT License
* You may not use this file except in compliance with the License.
*
* ================================================================ */
'use strict';
"use strict";
const ipv4 = require('..');
const assert = require('assert');
const validator = require('validator');
var ipv4 = require('../');
describe('', function(){
describe('test', () => {
it('should be ok', () => {
assert(validator.isIP(ipv4), true);
});
});

Sorry, the diff of this file is not supported yet

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