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

babel-plugin-gjs

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-gjs

babel plugin for gjs

  • 0.0.11
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

babel-plugin-gjs

GitHub stars

babel plugin for gjs

For best results, run transpiled code with CGJS

Please ★ this repo if you found it useful ★ ★ ★

Features

Wraps classes with GObject.registerClass
Before
class MyWindow extends Gtk.Window {
  constructor() {
    super({ title: 'Hello World' });
    this.button = new Gtk.Button({ label: 'Click here' });
    this.button.connect('clicked', this.handleClicked);
    this.add(this.button);
  }

  handleClicked() {
    console.log('Button clicked');
  }
}
After
const GObject = imports.gi.GObject;

const MyWindow = GObject.registerClass(
  class MyWindow extends Gtk.Window {
    _init() {
      super._init({ title: 'Hello World' });
      this.button = new Gtk.Button({ label: 'Click here' });
      this.button.connect('clicked', this.handleClicked);
      this.add(this.button);
    }

    handleClicked() {
      console.log('Button clicked');
    }
  }
);

Installation

npm install --save-dev babel-plugin-gjs

.babelrc

{
  "presets": [
    [
      "@babel/preset-env",
      {
        "targets": {
          "node": "4"
        }
      }
    ]
  ],
  "plugins": ["gjs"]
}

Dependencies

Usage

babel src -d lib
cgjs lib

Support

Submit an issue

Screenshots

Contribute a screenshot

Contributing

Review the guidelines for contributing

License

MIT License

Jam Risser © 2018

Changelog

Review the changelog

Credits

Support on Liberapay

A ridiculous amount of coffee ☕ ☕ ☕ was consumed in the process of building this project.

Add some fuel if you'd like to keep me going!

Liberapay receiving Liberapay patrons

Keywords

FAQs

Package last updated on 21 Aug 2019

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