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

podshim

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

podshim

Provides utility functions to shim the Podfile of a React Native application programatically.

  • 1.0.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

PodShim

What is PodShim?

PodShim allows you to programatically add Pods to a Podfile.

Warning

You should not manipulate the Podfile flippantly, do not accept user input as it could result in Podfile injection. Static, safe, and tested changes are key to making this an effective solution.

Usage

Creating Pod Reference

import { pod } from "podshim";

// pod 'PodName'
console.log(
  pod({
    name: "PodName",
  })
);

// pod 'PodName', '>= 0.2'
console.log(
  pod({
    name: "PodName",
    version: ">= 0.2",
  })
);

// pod 'PodName', :git => 'https://github.com/PodName/PodName.git'
console.log(
  pod({
    name: "PodName",
    git: "https://github.com/PodName/PodName.git",
  })
);

Shimming Podfile Contents

import { readFileSync, writeFileSync } from "fs";
import { pod, shim } from "podshim";

/**
 * Will add the pod reference above the line that contains
 * the 'use_framework' string. 
 */
const contents = readFileSync("./Podfile", "utf-8");
const modified = shim({
  contents,
  anchor: "use_frameworks",
  insert: [
    pod({ name: "Podname" })
  ]
});

writeFileSync("./Podfile", "utf-8");

Keywords

FAQs

Package last updated on 14 Jun 2022

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

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