New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

comal

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

comal

TacoScript transformation core

latest
Source
npmnpm
Version
0.6.3
Version published
Weekly downloads
15
-31.82%
Maintainers
1
Weekly downloads
 
Created
Source

comal

Tacoscript transformation core.

Originally forked from babel-core. Significant differences include removal of hardcoded ids, allows custom generators and parsers, uses comal-types and comal-traverse instead of their babel counterparts, and splits up babel-core's File (which contains the data and performs the transformation) into Transformation (which just performs the transformation) and File (which just contains the data).

Install

$ npm install comal

Usage

import comal from 'comal';

const minimalBabel = new Api({
  parser: require("babylon"),
  parserOpts: function(opts) {
    return {
      highlightCode: opts.highlightCode,
      sourceType:    opts.sourceType,
      filename:      opts.filename,
      plugins:       []
    };
  },
  generator: { generate: require("babel-generator").default },
  generatorOpts: function(opts) {
    return {
      filename: opts.filename
    }
  }
});

// not implemented yet
const tacoscriptCompiler = new Api({
  parser: require("horchata"),
  generator: require("alpastor")
});

const code = `a = () ->`;
const result = tacoscriptCompiler.transform(code, { /* options */ });

result.code; // Generated JavaScript code
result.map; // Sourcemap
result.ast; // AST

import {render} from 'tacoscript-cst-utils';
render(result.ast, 'tacoscriptSourceElements'); // whitespace-preserved tacoscript
render(result.ast, 'sourceElements'); // whitespace-preserved javascript

import generateTacoscript from 'tacotruck';
generateTacoscript(result.ast); // Generated tacoscript code

format of api config

For now, see cleanMeta() in options/loader and transformation/index

Keywords

tacoscript

FAQs

Package last updated on 05 Aug 2016

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