Comparing version 0.2.0 to 1.0.0
{ | ||
"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 | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
13312
1
174
0
+ Added@stamp/compose@1.0.2(transitive)
+ Added@stamp/core@1.0.1(transitive)
+ Added@stamp/is@1.0.0(transitive)
+ Added@stamp/shortcut@1.0.2(transitive)
- Removed@stamp/compose@0.1.6(transitive)
- Removed@stamp/core@0.1.2(transitive)
- Removed@stamp/shortcut@0.4.1(transitive)
Updated@stamp/compose@^1.0.0
Updated@stamp/core@^1.0.0
Updated@stamp/shortcut@^1.0.0