[node.js] générer un fichier non vide
Résolu
Utilisateur anonyme
-
Jithel Messages postés 843 Date d'inscription Statut Membre Dernière intervention -
Jithel Messages postés 843 Date d'inscription Statut Membre Dernière intervention -
A voir également:
- [node.js] générer un fichier non vide
- Fichier bin - Guide
- Comment réduire la taille d'un fichier - Guide
- Comment ouvrir un fichier epub ? - Guide
- Fichier rar - Guide
- Fichier .dat - Guide
1 réponse
Définir la fonction whatismyip() :
Code non testé.
Source : https://stackoverflow.com/questions/3653065/get-local-ip-address-in-node-js
var whatismyip = function(){ var os = require('os'); var ifaces = os.networkInterfaces(); var IP = "127.0.0.1"; // localhost by default Object.keys(ifaces).forEach(function (ifname) { ifaces[ifname].forEach(function (iface) { if ('IPv4' !== iface.family || iface.internal !== false) { // skip over internal (i.e. 127.0.0.1) and non-ipv4 addresses return; } IP = iface.address; return; }); return; }); }
Code non testé.
Source : https://stackoverflow.com/questions/3653065/get-local-ip-address-in-node-js