Socket
Socket
Sign inDemoInstall

preval.macro

Package Overview
Dependencies
48
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    preval.macro

Pre-evaluate code at build-time with babel-macros


Version published
Weekly downloads
11K
decreased by-33.24%
Maintainers
1
Install size
1.14 MB
Created
Weekly downloads
 

Readme

Source

preval.macro

This is a babel-plugin-macros macro for babel-plugin-preval.

Please see those projects for more information.

Installation

This module is distributed via npm which is bundled with node and should be installed as one of your project's devDependencies:

npm install --save-dev preval.macro

You'll also need to install and configure babel-plugin-macros if you haven't already.

Usage

Once you've configured babel-plugin-macros you can import/require preval.macro. For example:

import preval from 'preval.macro'

const one = preval`module.exports = 1 + 2 - 1 - 1`

Note:

babel-plugin-preval allows you to have a few more APIs than you have with this macro, but this macro comes with all the benefits of using babel-plugin-macros (which you can read about in the babel-plugin-macros docs).

Keywords

FAQs

Last updated on 25 Mar 2020

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