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

nodent-loader

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodent-loader

A loader for webpack to transform ES7 async/await statements using nodent

  • 1.2.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
2
Weekly downloads
 
Created
Source

nodent-loader

Purpose

nodent-loader will transform ES7 async/await statements used in source files loaded by webpack using nodent to produce code that is suitable for consumption by other loaders (e.g. babel) or for webpack output.

Typical usage

In your webpack.config.js:

{
	module: {
		loaders: [
			{
				test: /\.js$/,
				loader: 'nodent-loader',
				exclude: /(node_modules)/
			}
		]
	}
}

Configuration

A query can be specified which will pass the options to the nodent compiler.

The can be defined by following the format (specified by loader-utils):

null                   -> {}
?                      -> {}
?flag                  -> { flag: true }
?+flag                 -> { flag: true }
?-flag                 -> { flag: false }
?xyz=test              -> { xyz: "test" }
?xyz[]=a               -> { xyz: ["a"] }
?flag1&flag2           -> { flag1: true, flag2: true }
?+flag1,-flag2         -> { flag1: true, flag2: false }
?xyz[]=a,xyz[]=b       -> { xyz: ["a", "b"] }
?a%2C%26b=c%2C%26d     -> { "a,&b": "c,&d" }
?{json:5,data:{a:1}}   -> { json: 5, data: { a: 1 } }
E.g.
{
	module: {
		loaders: [
			{
				test: /\.js$/,
				loader: 'nodent-loader?+promises,+wrapAwait',
				exclude: /(node_modules)/,
			}
		]
	}
}

or by passing an object to the query property

{
	module: {
		loaders: [
			{
				test: /\.js$/,
				loader: 'nodent-loader',
				exclude: /(node_modules)/,
				query: {
					promises: true,
					wrapAwait: true
				}
			}
		]
	}
}

Todo

  • Add tests

Keywords

FAQs

Package last updated on 10 Oct 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

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