Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sugar-core

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sugar-core - npm Package Compare versions

Comparing version 0.0.1 to 2.0.0

LICENSE

40

package.json
{
"name": "sugar-core",
"version": "0.0.1",
"description": "Core module for Sugar. Provides native extending functionality.",
"keywords": ["functional", "utility"],
"homepage": "http://sugarjs.com/",
"author": "Andrew Plummer",
"main": "core.js",
"repository" : {
"type" : "git",
"url": "https://github.com/andrewplummer/sugar-core"
"description": "Core package for the Sugar Javascript utility library.",
"keywords": [
"sugar",
"sugarjs",
"functional",
"browser",
"utility",
"util"
],
"homepage": "https://sugarjs.com/",
"icon": "https://sugarjs.com/icon.svg",
"author": "Andrew Plummer <plummer.andrew@gmail.com>",
"license": "MIT",
"main": "sugar-core.js",
"repository": {
"type": "git",
"url": "git+https://github.com/andrewplummer/Sugar.git"
},
"engines" : {"node" : ">= 0.4.0"},
"license": "MIT"
}
"bugs": {
"url": "https://github.com/andrewplummer/Sugar/issues"
},
"engines": {
"node": ">= 0.8.23"
},
"browser": {
"buffer": false
},
"version": "2.0.0"
}

@@ -0,7 +1,66 @@

# sugar-core
# Sugar Core
This is the core package of the [Sugar](https://github.com/andrewplummer/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.
This is the core module for Sugar. It exists to give a hook for creating plugins for Sugar, and is a dependency of Sugar itself.
Issues are not active in this repo, please post them to the main Sugar repo instead:
## Documentation
https://github.com/andrewplummer/Sugar
#### [https://sugarjs.com/docs/](https://sugarjs.com/docs/)
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.
## defineStatic
Defines a method to be called on the Sugar global or on a native global in
extended mode.
## defineInstance
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`.
## defineInstanceAndStatic
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.
## defineStaticWithArguments
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.
## defineInstanceWithArguments
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.
## defineStaticPolyfill
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.
## defineInstancePolyfill
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.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc