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

fractus

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fractus

a browser-based editor

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Fractus Editor

This is the editor component of Stratus Editor.

Standalone

Be sure you have stratus-bundle installed, along with any syntaxes you plan on using.

To build the standalone editor:

$ npm install fractus -g
# Pass the languages you want to include,
# and the paths to the JS and CSS files to write.
$ fractus -l Ruby,JavaScript -j ./fractus.js -c ./fractus.css

Then, include the JavaScript and CSS files that it writes in your HTML.

This will turn $("#some-element") into an editor:

jQuery(function($) {
  var fractus = require("fractus");
  var editor  = fractus($("#some-element"),
    { text:   "some\ntext"
    , syntax: window.fractusBundles["Ruby"]
  });
});

API

For Fractus' API, see the Stratus documentation.

editor.text()

Get the editor's text:

editor.text();
// => "some\ntext"

CLI

Usage: fractus.coffee [options]

Options:

  -h, --help           output usage information
  -V, --version        output the version number
  -l, --langs <langs>  Bundle the comma-separated syntaxes (required).
  -j, --js <file>      The JavaScript output file.
  -c, --css <file>     The CSS output file.
  -t, --theme <theme>  The theme name.
  -q, --jquery         Dont include the jQuery source

License

See LICENSE.

Keywords

FAQs

Package last updated on 05 Feb 2012

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