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

alamode

Package Overview
Dependencies
Maintainers
1
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alamode

A Node.js regex-based transpiler of source code.

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
190
increased by16.56%
Maintainers
1
Weekly downloads
 
Created
Source

alamode

npm version

alamode is a RegExp-based transpiler of source code in Node.js. It is a fast, low-weight alternative to AST-based transpilers, such as @babel.

Table Of Contents

Installation

alamode can be either installed globally, or as a library. The library can be used either programmatically, or via package.json to refer to a binary in node_modules/.bin from a yarn or npm script.

Global

Install as a global binary from CLI and use to transpile source code files.

Installation CommandUsage Command
npm i -g alamode yarn build
/* project structure */
src
└── index.js
build
├── index.js
└── index.js.map

Dependency

Install as a dependency and use API to run programmatically in other Node.js software, or access the alamode binary via a yarn or npm script.

Installation CommandUsage Command
yarn add -DE alamode node build
/* build.js */
import alamode from 'alamode'

const src = 'src'
const output = 'build'

;(async () => {
  await alamode({
    src,
    output,
  })
})()
yarn build
// package.json
{
  "name": "project",
  "version": "1.0.0",
  "description": "Example.",
  "main": "build",
  "scripts": {
    "test": "zoroaster test/spec",
    "build": "alamode src -o build"
  },
  "files": [
    "build"
  ],
  "license": "MIT",
  "devDependencies": {},
  "dependencies": {}
}

Demo

In the demo below, a project's src directory is transpiled to replace import and export statements and placed in the build directory.

Using Package.json Script To Transpile
Transpiling a project's source code into build dir.

API

The package is available by importing its default function:

import alamode from 'alamode'

alamode(
  arg1: string,
  arg2?: boolean,
): void

Call this function to get the result you want.

/* yarn example/ */
import alamode from 'alamode'

(async () => {
  await alamode()
})()

CLI

alamode src -o build

(c) À La Mode 2018

Keywords

FAQs

Package last updated on 25 Jul 2018

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