git404hub

what is core-decorators fr?

jayphelps/core-decorators — explained in plain English

Analysis updated 2026-06-26

4,497JavaScriptAudience · developerComplexity · 2/5Setup · moderate

tl;dr

A JavaScript library of ready-made class decorators like @autobind and @readonly, but built against an outdated spec, best avoided for new projects in favor of modern alternatives.

vibe map

mindmap
  root((core-decorators))
    What It Does
      Ready-made decorators
      Class method helpers
    Key Decorators
      autobind
      readonly
      deprecate
      mixin
    Intended Use
      React projects
      Angular projects
    Limitations
      Old spec stage-0
      Mostly unmaintained
    Setup
      Babel legacy plugin
      npm install

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

what do people make with this?

VIBE 1

Add @autobind to React component methods to avoid manual this-binding in constructors

VIBE 2

Mark old methods with @deprecate to warn other developers they should stop using them

VIBE 3

Use @readonly to prevent accidental reassignment of class properties at runtime

VIBE 4

Mix reusable behaviors into a class with @mixin without changing its inheritance chain

what's the stack?

JavaScriptBabel

how it stacks up fr

jayphelps/core-decoratorshotheadhacker/seedbox-liteyomguithereal/react-blessed
Stars4,4974,4984,499
LanguageJavaScriptJavaScriptJavaScript
Setup difficultymoderatemoderatemoderate
Complexity2/53/53/5
Audiencedevelopergeneraldeveloper

Figures from each repo's GitHub metadata at analysis time.

how do i run it?

Difficulty · moderate time til it works · 30min

Requires babel-plugin-transform-decorators-legacy, not compatible with modern decorators spec.

in plain english

core-decorators is a JavaScript library that provides a set of ready-made decorators for use with classes and class methods. Decorators are a syntax feature that lets you attach behavior to a function or class by placing an annotation (starting with @) directly above it, similar to how annotations work in Java or Python. For example, placing @autobind above a method ensures that the method always refers to its own class instance even when passed around as a standalone function, a common headache in React development. Placing @readonly on a property prevents it from being reassigned. Placing @deprecate on a method logs a console warning when the method is called, signaling to other developers that they should stop using it. The full list of decorators in the library includes @autobind, @readonly, @override, @deprecate, @suppressWarnings, @nonenumerable, @nonconfigurable, @lazyInitialize, @time, @profile, and @mixin, among others. Several of these are marked as deprecated within the library itself because the scope has been narrowed over time. An important caveat is stated at the top of the README: this library was written against an early draft of the JavaScript decorators specification (stage-0) that has since changed in incompatible ways. The decorators proposal has moved to a substantially different stage-2 form. As a result, the README explicitly says the library should mostly be considered unmaintained and is probably best avoided for new projects. It will only receive security or critical fixes until the decorator specification stabilizes further. The library was designed to work with Babel 5 or with the babel-plugin-transform-decorators-legacy plugin. It does not officially support TypeScript. It has no framework dependency and was widely used in React and Angular projects during the period when this version of the decorator spec was common.

prompts (copy fr)

prompt 1
How do I use @autobind from core-decorators to fix 'this is undefined' errors in my React component methods?
prompt 2
Show me how to apply @deprecate from core-decorators so it logs a warning when an old API method is called
prompt 3
Using core-decorators, how do I make a class property @readonly so it throws when someone tries to reassign it?
prompt 4
My project uses core-decorators but the decorators spec changed, what modern replacement should I migrate to?

Frequently asked questions

what is core-decorators fr?

A JavaScript library of ready-made class decorators like @autobind and @readonly, but built against an outdated spec, best avoided for new projects in favor of modern alternatives.

What language is core-decorators written in?

Mainly JavaScript. The stack also includes JavaScript, Babel.

How hard is core-decorators to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is core-decorators for?

Mainly developer.

peek the repo → explain another one

This repo across BitVibe Labs

double-check against the repo, no cap.