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

@babel/plugin-proposal-class-properties

Package Overview
Dependencies
Maintainers
6
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/plugin-proposal-class-properties

This plugin transforms static class properties as well as properties declared with the property initializer syntax

  • 7.16.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.7M
decreased by-61.95%
Maintainers
6
Weekly downloads
 
Created

What is @babel/plugin-proposal-class-properties?

The @babel/plugin-proposal-class-properties package is a Babel plugin that allows you to use the class properties syntax in JavaScript. This syntax is part of a proposal for ECMAScript and has not been finalized yet, but this plugin lets you use it with Babel to compile your code to a version of JavaScript that is compatible with current environments. It supports both static and instance properties, as well as public and private fields.

What are @babel/plugin-proposal-class-properties's main functionalities?

Static Class Properties

Allows you to define static properties on a class, which are properties that are accessed on the class itself, not on instances of the class.

class MyClass {\n  static myStaticProp = 42;\n}

Instance Class Properties

Enables you to define properties directly on class instances, with an initial value, without needing to set them inside the class constructor.

class MyClass {\n  myInstanceProp = 'default value';\n}

Public Class Fields

Supports the declaration of public fields in a class, which are accessible from outside of the class.

class MyClass {\n  publicField = 'some value';\n}

Private Class Fields

Allows the definition of private fields in a class, which are only accessible within the class itself using the '#' syntax.

class MyClass {\n  #privateField = 'hidden value';\n}

Other packages similar to @babel/plugin-proposal-class-properties

Keywords

FAQs

Package last updated on 31 Dec 2021

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