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

blockly

Package Overview
Dependencies
Maintainers
2
Versions
139
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

blockly

Blockly is a library for building visual programming editors.

  • 3.20191014.2
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

Blockly

Google's Blockly is a web-based, visual programming editor. Users can drag blocks together to build programs. All code is free and open source.

The source for this module is in the Blockly repo.

Installation

You can install this package either via npm or unpkg.

npm

npm install blockly

unpkg

<script src="https://unpkg.com/blockly/blockly.min.js"></script>

Example Usage

import Blockly from 'blockly';
Blockly.inject('blocklyDiv', {
    ...
})

Samples

For samples on how to integrate Blockly into your project, view the list of samples at blockly-samples.

Importing Blockly

When you import Blockly with import * as Blockly from 'blockly'; you'll get the default modules: Blockly core, Blockly built-in blocks, the JavaScript generator and the English lang files.

If you need more flexibility, you'll want to define your imports more carefully:

Blockly Core
import * as Blockly from 'blockly/core';
Blockly built in blocks
import 'blockly/blocks';
Blockly Generators

If your application needs to generate code from the Blockly blocks, you'll want to include a generator.

import 'blockly/python';

to include the Python generator, you can also import blockly/javascript, blockly/php, blockly/dart and blockly/lua.

Blockly Languages
import * as Fr from 'blockly/msg/fr';
Blockly.setLocale(Fr);

To import the French lang files. Once you've imported the specific lang module, you'll also want to set the locale in Blockly.

For a full list of supported Blockly locales, see: https://github.com/google/blockly/tree/master/msg/js

License

Apache 2.0

Keywords

FAQs

Package last updated on 22 Oct 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