Socket
Socket
Sign inDemoInstall

@stamp/it

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stamp/it - npm Package Compare versions

Comparing version 0.2.0 to 1.0.0

10

package.json
{
"name": "@stamp/it",
"version": "0.2.0",
"version": "1.0.0",
"description": "A nice, handy API implementation of the compose standard",

@@ -13,11 +13,11 @@ "main": "index.js",

"dependencies": {
"@stamp/compose": "^0.1.5",
"@stamp/core": "^0.1.2",
"@stamp/compose": "^1.0.0",
"@stamp/core": "^1.0.0",
"@stamp/is": "^0.1.2",
"@stamp/shortcut": "^0.4.0"
"@stamp/shortcut": "^1.0.0"
},
"devDependencies": {
"@stamp/check-compose": "^1.0.2",
"@stamp/check-compose": "^1.0.3",
"lodash": "^4.17.4"
}
}

@@ -0,4 +1,5 @@

<img src="https://raw.githubusercontent.com/stampit-org/stampit-logo/master/stampit-logo.png" alt="stampit" width="320" />
# @stamp/it
_A nice, handy API implementation of the compose standard_
_Utility belt implementation of the [compose](https://github.com/stampit-org/stamp-specification) standard_

@@ -16,5 +17,46 @@ This module is the new cool modern version of the [`stampit`](https://github.com/stampit-org/stampit) module. Consider `@stamp/it` as stampit v4.

```js
import stampit from '@stamp/it';
import stampit from '@stamp/it'
```
Or import utility functions only:
```js
import {
methods,
props,
properties,
statics,
staticProperties,
conf,
configuration,
deepProps,
deepProperties,
deepStatics,
staticDeepProperties,
deepConf,
deepConfiguration,
init,
initializers,
composers,
propertyDescriptors,
staticPropertyDescriptors
} from '@stamp/it'
const Stamp1 = methods({ foo() {} })
const Stamp2 = props({ bar: 'my bar' })
const Stamp3 = conf({ my: 'configuration' })
const Stamp4 = init(function (options, {stamp, instance, args}) {
console.log('bla')
})
```
## API

@@ -61,3 +103,3 @@

const S5 = stampit({
init: function () { console.log('hi form initializer'); }
init: function () { console.log('hi form initializer') }
})

@@ -84,10 +126,10 @@ // or

```js
const Stamp = compose(S1, S2, S3, S4, S5, S6, S7);
console.log(Stamp);
const Stamp = compose(S1, S2, S3, S4, S5, S6, S7)
console.log(Stamp)
// { compose: [function] { properties, methods, staticProperties, initializers, configuration } }
const obj = Stamp();
console.log(obj);
const obj = Stamp()
console.log(obj)
// { myProperty: 42 }
console.log(Object.getPrototypeOf(obj));
console.log(Object.getPrototypeOf(obj))
// { myMethod: [function] }

@@ -101,6 +143,10 @@ ```

#### The Stamp.create() static method
Calling `Stamp.create()` is identical to calling `Stamp()`.
#### Shortcut static methods
All stamps receive few static properties.
These are taken from the [@stamp/shortcut](https://github.com/stampit-org/stamp/blob/master/packages/shortcut/README.md) stamp.
These are taken from the [`@stamp/shortcut`](https://github.com/stampit-org/stamp/blob/master/packages/shortcut/README.md) stamp.
For example:

@@ -115,4 +161,18 @@ ```js

#### The Stamp.create() static method
Calling `Stamp.create()` is identical to calling `Stamp()`.
### Shortcut exported methods
The module exports a range of shortcut methods.
These are taken from the [`@stamp/shortcut`](https://github.com/stampit-org/stamp/blob/master/packages/shortcut/README.md) stamp.
```js
import {methods, props, init, statics, /* etc */} from '@stamp/it'
```
Each returns a stampit-flavoured stamp.
NOTE! Unlike the [`@stamp/shortcut`](https://www.npmjs.com/package/@stamp/shortcut) module, all the exported functions of `@stamp/it` are stampit-flavoured. Meaning that:
```js
import {methods} from '@stamp/it'
const Stamp = methods({ foo() {} })
.props({bar: 1}) // THIS WILL WORK
.statics({baz: 2}) // AND THIS WILL WORK TOO
```
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