![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
@pinpoint-apm/shimmer
Advanced tools
https://github.com/othiym23/shimmer.git differs in that it prevents duplicates monkeypatch.
shimmer
does a bunch of the work necessary to wrap other methods in
a wrapper you provide:
var http = require('http');
var shimmer = require('shimmer');
shimmer.wrap(http, 'request', function (original) {
return function () {
console.log("Starting request!");
var returned = original.apply(this, arguments)
console.log("Done setting up request -- OH YEAH!");
return returned;
};
});
There are times when it's necessary to monkeypatch default behavior in JavaScript and Node. However, changing the behavior of the runtime on the fly is rarely a good idea, and you should be using this module because you need to, not because it seems like fun.
All monkeypatched functions have an attribute, Symbol('__wrapped')
, set to true on
them.
If you pass in an options object containing a function labeled logger
,
shimmer
will use it instead of the logger, which defaults to console.error
.
shimmer
is built to be as unobtrusive as possible and has no need to run
asynchronously, so it defaults to logging when things fail, instead of
throwing.
shimmer
monkeypatches in place, so it expects to be passed an object.
It accepts either instances, prototypes, or the results of calling
require
. name
must be the string key for the field's name on the
object.
wrapper
is a function that takes a single parameter, which is the original
function to be monkeypatched. shimmer
assumes that you're adding behavior
to the original method, and not replacing it outright. If you are replacing
the original function, feel free to ignore the passed-in function.
If you aren't discarding the original, remember these tips:
original.apply(this, arguments)
,
unless your reason for monkeypatching is to transform the arguments.Just like wrap
, with the addition that you can wrap multiple methods on
multiple modules. Note that this function expects the list of functions to be
monkeypatched on all of the modules to be the same.
A convenience function for restoring the function back the way it was before you started. Won't unwrap if somebody else has monkeypatched the function after you (but will log in that case). Won't throw if you try to double-unwrap a function (but will log).
Just like unwrap
, with the addition that you can unwrap multiple methods on
multiple modules. Note that this function expects the list of functions to be
unwrapped on all of the modules to be the same.
FAQs
Safe(r) monkeypatching for JavaScript.
The npm package @pinpoint-apm/shimmer receives a total of 75 weekly downloads. As such, @pinpoint-apm/shimmer popularity was classified as not popular.
We found that @pinpoint-apm/shimmer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.