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

requirejs-transpiler

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

requirejs-transpiler

transpile requirejs to es module

0.1.2
latest
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created

requirejs-transpiler

transpile requirejs to ES Module

Compiled Output

An example like this:

  define(
    [
      'jquery'
    ],
    function ($) {
      return {
        init: function () {
          var o = $('#app');
        }
      };
    }
  );

and the output will be:

  import $ from "jquery";
  export default {
    init: function () {
      var o = $('#app');
    }
  };

Usage

Install:

  npm i requirejs-transpiler

API

  const { requirejs-transpiler } = require('requirejs-transpiler')

  requirejs-transpiler({  // options
    srcBasePath,
    srcPattern,
    distBasePath,
    prettier: true
  })

Options

The glob syntax from the glob module is used at srcPattern param.

OptionRequired
srcBasePathtrue
srcPatternfalse
distBasePathfalse
prettierfalse
prettierOptsfalse

Contributing

FAQs

Package last updated on 02 Jun 2017

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