1.0.1-alpha • Published 2 years ago

@astro_z/nodejs-intership-lesson-1 v1.0.1-alpha

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

nodejs-intership-lesson-1

NodeJs internship, lesson 1. Get Info by My Ip

npm install nodejs-intership-lesson-1

Usage

import { getIpByRequest, getPublicIpV4ByNetwork } from 'nodejs-intership-lesson-1';

console.log(getIpByRequest(request));
//=> '0.0.0.0'

console.log(await getPublicIpV4ByNetwork());
//=> '127.0.0.1'

API

The package returns the address of the internet-facing interface, as determined from the default gateway. When the address cannot be determined for any reason, 0.0.0.0 will be returned.

The package relies on operating systems tools and also can return ip with request connection.

getIpByRequest()

Returns the IPv4 address with request connection.

getPublicIpV4ByNetwork()

Returns the internal IPv4 address.

acornansi-regexargparseajvacorn-jsxansi-stylesaria-queryarray.prototype.flatarray.prototype.flatmapast-types-flowarray-includesbrace-expansionaxe-corecallsitesconcat-mapbalanced-matchaxobject-querycolor-convertcall-bindchalkdamerau-levenshteincolor-namecore-js-pureconfusing-browser-globalsdeep-isdefine-propertiescross-spawnemoji-regexes-shim-unscopablesdoctrinedebuges-abstracteslint-config-airbnb-baseeslint-plugin-importes-to-primitiveescape-string-regexpeslint-import-resolver-nodeeslint-module-utilseslint-plugin-react-hookseslint-utilseslint-scopeeslint-plugin-reactesqueryesrecurseespreeestraverseesutilseslint-visitor-keyseslint-plugin-jsx-a11yfast-levenshteinfile-entry-cacheflat-cachefast-json-stable-stringifyflattedfunctional-red-black-treefast-deep-equalfs.realpathfunction.prototype.namefind-upget-intrinsicglob-parentglobget-symbol-descriptionhas-flagfunction-bindhashas-bigintshas-property-descriptorsfunctions-have-namesignoreimport-freshinflighthas-tostringtagimurmurhashhas-symbolsis-bigintinheritsis-globis-boolean-objectis-core-moduleis-extglobglobalsinternal-slotis-date-objectis-negative-zerois-regexis-symbolis-callableis-weakrefjs-tokensis-number-objectis-shared-array-bufferis-stringisexejs-yamljson-schema-traversejsx-ast-utilsjson-stable-stringify-without-jsonifylanguage-tagslodash.mergelevnlanguage-subtag-registryminimistlocate-pathjson5msobject-inspectloose-envifyminimatchobject-keysnatural-compareobject-assignobject.assignobject.valuesobject.entriesobject.fromentriesoptionatorobject.hasownp-tryp-limitpath-existspath-is-absoluteparent-modulepath-parsepunycodeoncep-locateprelude-lsreact-isresolve-fromprop-typespath-keyregexppshebang-commandregexp.prototype.flagsshebang-regexsemverresolveside-channelregenerator-runtimestring.prototype.matchallstrip-bomtext-tablestrip-ansistrip-json-commentsrimrafsupports-preserve-symlinks-flagtype-checksupports-coloruri-jstype-festwhich-boxed-primitiveword-wrapwrappystring.prototype.trimstartv8-compile-cachestring.prototype.trimendunbox-primitivetsconfig-pathswhich
1.0.1-alpha

2 years ago