Socket
Socket
Sign inDemoInstall

babel-plugin-ramda

Package Overview
Dependencies
5
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    babel-plugin-ramda

Ramda modularized builds without the hassle


Version published
Weekly downloads
96K
decreased by-5.55%
Maintainers
1
Install size
1.16 MB
Created
Weekly downloads
 

Readme

Source

babel-plugin-ramda Build Status

This plugin is a transform to remove unused ramda dependencies, without forcing the user to cherry pick methods manually. This lets you use ramda naturally (aka as documented) without worrying about bundling parts you're not using.

See also babel-plugin-lodash.

Example

Converts

import R, {map} from 'ramda';

map(R.add(1), [1, 2, 3]);

Roughly to

import add from 'ramda/src/add';
import map from 'ramda/src/map';

map(add(1), [1, 2, 3]);
Limitations
  • You must be using ES6 imports (both specifiers and default work) to load ramda.
FAQ

I receive TypeError: The plugin "ramda" didn’t export a Plugin instance
or, can I use this plugin with Babel v5?

Babel v5 is no longer supported. Use v0.1.2 for support.

Usage
{
  "plugins": ["ramda"]
}

or

{
  "plugins": [
    ["ramda", {
      "useES": true
    }]
  ]
}

to use the new ramda/es/ path for imports, which is available since Ramda 0.25. This is recommended as it uses ES modules rather than CommonJS. It defaults to ramda/src/ when omitted.

Via CLI
$ babel --plugins ramda script.js
Via Node API
require("babel-core").transform("code", {
  plugins: ["ramda"]
});

Keywords

FAQs

Last updated on 22 Jun 2022

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc