
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Node/browser library to detect global/window namespace pollution.
$ npm install antiglobal
$ bower install antiglobal
var antiglobal = require('antiglobal');
Take a browserified version of the library from the dist/
folder:
dist/antiglobal-X.Y.Z.js
: The uncompressed version.dist/antiglobal-X.Y.Z.min.js
: The compressed production-ready version.dist/antiglobal.js
: A copy of the uncompressed version.They all expose the global window.antiglobal
function.
<script src='antiglobal.js'></script>
<script src='js/antiglobal.js'></script>
<script src='js/foo.js'></script> // Creates window.FOO
<script>
antiglobal('FOO'); // OK, returns true
</script>
<script src='js/bar.js'></script> // Creates window.BAR
<script>
antiglobal('QWE'); // ERROR: given globals do not match real new globals
// [given: QWE | real: BAR]
</script>
antiglobal(name1, name2, ...)
functionnameN
: The name (string) of a new expected element in the global/window namespace.Returns true
if given arguments match the new elements in the global/window namespace.
It updates the list of elements in the global/window namespace for the next execution.
antiglobal.reset()
functionReset the list of elements in the global/window namespace. Useful to ignore globals introduced by a library while still allowing antiglobal()
to check other libraries loaded after that.
antiglobal.log
read/write propertyIf set to true
, errors when calling antiglobal()
are logged to console.error
.
Default value is true
.
antiglobal.throw
read/write propertyIf set to true
, errors when calling antiglobal()
throw an Error
exception.
Default value is false
.
Iñaki Baz Castillo.
ISC.
FAQs
Node/browser library to detect global/window namespace pollution
The npm package antiglobal receives a total of 7 weekly downloads. As such, antiglobal popularity was classified as not popular.
We found that antiglobal 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
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.