Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
ast-transform
Advanced tools
Readme
Convenience wrapper for performing AST transformations with browserify transform streams. Note that it doesn't handle source maps nicely, though pull requests are welcome!
ast(transform[, opts])
Where transform
is a function that takes a filename and returns a function,
e.g.:
var replace = require('replace-method')
var ast = require('ast-transform')
var path = require('path')
module.exports = ast(function (file) {
if (path.extname(file) !== '.js') return
return function(ast, done) {
// replace require calls with
// strings for some reason
replace(ast)(['require'], function(node) {
return { type: 'Literal', value: 'replaced!' }
})
done()
}
})
Note that you can return a falsey value instead of a function to bail the stream early and avoid the parse/deparse overhead. Here's an example of using the above with browserify:
var browserify = require('browserify')
var example = require('./example')
var fs = require('fs')
browserify('./index.js')
.transform(example)
.bundle()
.pipe(fs.createWriteStream(__filename + '/bundle.js'))
MIT. See LICENSE.md for details.
FAQs
Convenience wrapper for performing AST transformations with browserify transform streams
The npm package ast-transform receives a total of 710,603 weekly downloads. As such, ast-transform popularity was classified as popular.
We found that ast-transform 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.