New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

babel-plugin-local-ip

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-local-ip

Do you want to automatically replace local IP?

latest
Source
npmnpm
Version
1.0.4
Version published
Weekly downloads
235
-33.05%
Maintainers
1
Weekly downloads
 
Created
Source

Install

yarn add babel-plugin-local-ip -D
# or
npm install babel-plugin-local-ip -D

Config

// In babel.config.js
plugins: ["babel-plugin-local-ip"] # "LOCAL_IP" string will be replaced with the local IP of the machine where the metro is running.
# or
plugins: [
  [
    "babel-plugin-local-ip", {
        "replaceString": "FOO_LOCAL_IP", # (Option) If you want to change it to a different string value.
        "interfaceName": "en0" # (Option) If you can't use the network as en0, Replace "en0" with your network type name.
    }
  ]
]
  • If you cannot use en0, please refer to the original code.

Description

This plugin was created to automatically enter the local IP of the machine where reactotron is running.

import { Platform } from 'react-native';
import Reactotron from 'reactotron-react-native';

const os = Platform.OS;
Reactotron.configure({
    name: `App Name ${os}`,
    getClientId: async () => `App Name ${os}`,
    host: 'LOCAL_IP', // babel-plugin-local-ip will convert it to local IP on the machine your metro is running on.
})

AS-IS

const LocalIP = "Local_IP"

TO-BE

// if your local ip is "192.168.0.77"
const LocalIP = "192.168.0.77"

reference

FAQs

Package last updated on 26 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts