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

code-lightner

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

code-lightner

Use TextMate grammar and themes to highlights your code

  • 0.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Code Lightner

:warning: Current version of code-lightner only support Node.js.Browser support will be added later. :warning:

JavaScript version

Installing

npm install code-lightner

Using

const code = require('code-lightner');

const sourceCode =
    `
module Test

[<RequireQualifiedAccess>]
type FontStyle =
    | NotSet = -1
    | None = 0
    | Italic = 1
    | Bold = 2
    | Underline = 4
    `

let config =
    {
        backgroundColor: "#282c34", // Optional, set the background color of the pre element
        textColor: "#bbbbbbff", // Optional, set the color of the text
        grammarFiles: [ // Required, list of the grammar file to load
            "./syntaxes/JavaScript.tmLanguage.json",
            "./syntaxes/SQL.plist",
            "./syntaxes/hello.json",
            "./syntaxes/fsharp.json"
        ],
        scopeName: "source.fsharp", // Required, name of the scope to use on the provided code
        themeFile: "../themes/OneDark-Pro.json" // Required, path of the theme file
    };

code.lighten(config, sourceCode)
    .then(function(html) {
        console.log(html);
    });

Fable version

Coming soon

FAQs

Package last updated on 19 Feb 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