UNPKG
create-serve
Version:
latest (1.0.1)
1.0.1
1.0.0
0.1.0
0.0.0
🍛 Ultralight http server with live reload. [CLI + API]
github.com/nativew/serve
nativew/serve
create-serve
/
src
/
utils
/
getIp.js
7 lines
(5 loc)
•
174 B
JavaScript
View Raw
1
2
3
4
5
6
7
import
{ networkInterfaces }
from
'os'
;
export
const
getIp
= (
) =>
Object
.
values
(
networkInterfaces
()) .
flat
() .
find
(
ip
=>
ip.
family
==
'IPv4'
&& !ip.
internal
).
address
;