
Product
Introducing Reachability for PHP
Reachability analysis for PHP is now available in experimental, helping teams identify which vulnerabilities are actually exploitable.
This is the core package of the Sugar library. It provides basic behavior as well as the ability to define new methods. All Sugar npm packages depend on this package. Plugin developers can also depend on it to define new methods for Sugar plugins.
Note: All define methods are called on the global (or exported object in npm), and accept either a name and a function as two arguments or a single object mapping names to functions.
Defines a method to be called on the Sugar global or on a native global in extended mode.
Defines a method to be called on the Sugar global or as an instance method on
chainables or native objects in extended mode. All methods should accept the
instance object as their first argument, and should never refer to this.
Defines a method to be called both as an instance and static method. This method
is required for Object methods, which must be defined as both static (as Sugar
will not extend Object.prototype) and instance (for chainables). Use this for
any methods intended as Object instance methods.
This method is identical to defineStatic except that when methods are called,
they will collect any arguments past n - 1, where n is the number of
arguments that the method accepts. Collected arguments will be passed to the
method as the last argument defined.
This method is identical to defineInstance except that when methods are
called, they will collect any arguments past n - 1, where n is the number of
arguments that the method accepts. Collected arguments will be passed to the
method as the last argument defined.
Defines a static method that is mapped onto a native if it does not already exist. Intended only for creating polyfills that follow the ECMAScript spec.
Defines an instance method that is mapped onto a native prototype if it does not
already exist. Intended only for creating polyfills that follow the ECMAScript
spec. Note that this method differs from defineInstance as there is no static
signature (as the method is mapped as-is to the native), so it should refer to
its this object.
FAQs
Core module for the Sugar Javascript utility library.
The npm package sugar-core receives a total of 28,794 weekly downloads. As such, sugar-core popularity was classified as popular.
We found that sugar-core 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.

Product
Reachability analysis for PHP is now available in experimental, helping teams identify which vulnerabilities are actually exploitable.

Product
Export Socket alert data to your own cloud storage in JSON, CSV, or Parquet, with flexible snapshot or incremental delivery.

Research
/Security News
Bitwarden CLI 2026.4.0 was compromised in the Checkmarx supply chain campaign after attackers abused a GitHub Action in Bitwarden’s CI/CD pipeline.