New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-p5-push-pop

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-p5-push-pop

This babel plugin provides you a way to organize your P5 code. It replaces all anonym blocks with `push` and `pop`. The advantage is less writing work and now you can fold and indent these blocks automatically within your IDE.

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

babel-plugin-p5-push-pop

This babel plugin provides you a way to organize your P5 code. It replaces all anonym blocks with push and pop. The advantage is less writing work and now you can fold and indent these blocks automatically within your IDE.

you can now write this:

function setup() {
  ellipse(0, 50, 33, 33);

  {
    strokeWeight(10);
    fill(204, 153, 0);
    ellipse(33, 50, 33, 33);

    {
      stroke(0, 102, 153);
      ellipse(66, 50, 33, 33);
    }
  }

  ellipse(100, 50, 33, 33);
}

instead of:

function setup() {
  ellipse(0, 50, 33, 33);

  push();
  strokeWeight(10);
  fill(204, 153, 0);
  ellipse(33, 50, 33, 33);

  push();
  stroke(0, 102, 153);
  ellipse(66, 50, 33, 33);
  pop();
  pop();

  ellipse(100, 50, 33, 33);
}

How to use

yarn add -D babel-plugin-p5-push-pop
# or
npm install -D babel-plugin-p5-push-pop

.babelrc

{
  "presets": ["@babel/env"],
  "plugins": ["p5-push-pop"]
}

Example

You can find a fully working example inside ./example. Just run npm install and npm start or npm build.

FAQs

Package last updated on 10 Jul 2020

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