Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
atom-babel6-transpiler
Advanced tools
A transpiler for Atom packages that processes code with Babel
This project implements an Atom package transpiler that transpiles your package's files with Babel 6.
atomTranspilers
entry to your package.json
In detail:
1. First, install the package from the npm registry:
npm install --save atom-babel6-transpiler
2. Next, modify your package.json
to include a reference to the transpiler for any files you want Babel to process as described in the Atom Flight Manual. For example, to process every file ending in .js
in your package, you could use:
{
...
"atomTranspilers": [
{
"glob": "**/*.js",
"transpiler": "atom-babel6-transpiler"
}
]
}
3. Finally, install Babel and all the presets and plugins you want to use as normal. For a simple example, if you wanted to use the ES2015 and React presets, you might run:
npm install --save babel-preset-es2015 babel-preset-react
and then create a .babelrc
file to configure Babel to use them:
{
"presets": ["es2015", "react"]
}
You may also specify options in your package.json
inside the optional options
object; the subkey babel
, if it exists, will be passed as options to babel.transform
. Note that if you don't want Babel to search up the directory hierarchy for a .babelrc
file, you need to add the "babelrc": false
option to the settings. Otherwise Babel may mistakenly use a user's .babelrc
from elsewhere on the filesystem when trying to build your package.
{
// ...
"atomTranspilers": [
{
"glob": "**/*.js",
"transpiler": "atom-babel6-transpiler",
"options": {
"babel": {
"presets": ["es2015", "react"],
"babelrc": false
}
}
}
]
}
You may specify the following options as values of the options
object in your package.json
:
Option | Default | Description |
---|---|---|
setBabelEnv | false , true or a string | Sets the BABEL_ENV environment variable. When true , sets it to "development" when atom.inDevMode() or atom.inSpecMode() is true and "production" otherwise. When given as a string, uses the value of the environment variable of that name instead. The feature returns BABEL_ENV to its prior value after transpilation finishes. |
babel | {} | Options to pass as the second argument to babel.transform (the same options you can put in a .babelrc ). |
cacheKeyFiles | [] | An array of files to include when determining whether or not to use the cache. For example, to force a recompile anytime your .babelrc changes, add .babelrc to this array. |
To enable source maps within Atom, set the Babel sourceMaps
option to "inline"
in your Babel configuration.
Babel supports an option called env
that allows you to configure Babel on a per-environment basis. The Babel environment is controlled via an environment variable called BABEL_ENV
; this module automatically sets the environment variable to "development"
if Atom is in dev mode (atom.inDevMode()
returns true
) and "production"
otherwise.
FAQs
A transpiler for Atom packages that processes code with Babel
The npm package atom-babel6-transpiler receives a total of 7 weekly downloads. As such, atom-babel6-transpiler popularity was classified as not popular.
We found that atom-babel6-transpiler demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.