
Security News
The Nightmare Before Deployment
Season’s greetings from Socket, and here’s to a calm end of year: clean dependencies, boring pipelines, no surprises.
babel-plugin-define-function
Advanced tools
A plugin for Babel 6 allows you to define dynamic variables at build time with functions.
All of the defined variables must exist in a .babel-define.js or .babel-define.json file.
$ npm install babel-plugin-define-function --save-dev
$ babel --plugins define-function script.js
Given the following definitions:
var exec = require('child_process').execSync
var details = require('./package.json')
var buildNumber = 0
module.exports = {
// Define a static version variable.
__VERSION__: details.version,
// Evaluate git commit at build time.
__GIT_COMMIT__: function () {
// This function will be called on each build.
return exec('git rev-parse HEAD') + '-' + buildNumber++
}
}
And the following file:
console.log('package version is ' + __VERSION__)
console.log('git build is ' + __GIT_COMMIT__)
becomes:
console.log('package version is ' + '1.0.0')
console.log('git build is ' + '0c25b7ea0ed7554b7da285907154b66a694c3060-0')
and on the second build (if watching):
console.log('package version is ' + '1.0.0')
console.log('git build is ' + '0c25b7ea0ed7554b7da285907154b66a694c3060-1')
FAQs
Babel plugin to insert templates at build time.
The npm package babel-plugin-define-function receives a total of 0 weekly downloads. As such, babel-plugin-define-function popularity was classified as not popular.
We found that babel-plugin-define-function demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.

Security News
Season’s greetings from Socket, and here’s to a calm end of year: clean dependencies, boring pipelines, no surprises.

Research
/Security News
Impostor NuGet package Tracer.Fody.NLog typosquats Tracer.Fody and its author, using homoglyph tricks, and exfiltrates Stratis wallet JSON/passwords to a Russian IP address.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.