Installations
npm install @stamp/it
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
6.11.1
NPM Version
3.10.10
Score
72.7
Supply Chain
99.5
Quality
77
Maintenance
100
Vulnerability
100
License
Releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (76.52%)
TypeScript (23.48%)
Developer
Download Statistics
Total Downloads
535,111
Last Day
81
Last Week
1,254
Last Month
5,601
Last Year
70,787
GitHub Statistics
25 Stars
298 Commits
3 Forks
10 Watching
4 Branches
9 Contributors
Bundle Size
4.70 kB
Minified
1.71 kB
Minified + Gzipped
Package Meta Information
Latest Version
1.1.0
Package Id
@stamp/it@1.1.0
Unpacked Size
13.71 kB
Size
3.98 kB
File Count
6
NPM Version
3.10.10
Node Version
6.11.1
Total Downloads
Cumulative downloads
Total Downloads
535,111
Last day
-64.3%
81
Compared to previous day
Last week
-3.7%
1,254
Compared to previous week
Last month
-11.5%
5,601
Compared to previous month
Last year
-23.8%
70,787
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
4
Dev Dependencies
2
Utility belt implementation of the compose standard
This module is the new cool modern version of the stampit
module. Consider @stamp/it
as stampit v4.
Usage
Install:
1$ npm i -S @stamp/it
Import:
1import stampit from '@stamp/it'
Or import utility functions only:
1import { 2 methods, 3 4 props, 5 properties, 6 7 statics, 8 staticProperties, 9 10 conf, 11 configuration, 12 13 deepProps, 14 deepProperties, 15 16 deepStatics, 17 staticDeepProperties, 18 19 deepConf, 20 deepConfiguration, 21 22 init, 23 initializers, 24 25 composers, 26 27 propertyDescriptors, 28 29 staticPropertyDescriptors 30} from '@stamp/it' 31 32const Stamp1 = methods({ foo() {} }) 33const Stamp2 = props({ bar: 'my bar' }) 34const Stamp3 = conf({ my: 'configuration' }) 35const Stamp4 = init(function (options, {stamp, instance, args}) { 36 console.log('bla') 37})
API
Arguments
See more examples in this blog post.
Create a new empty stamp:
1const S1 = stampit()
Create a new stamp with a method:
1const S2 = stampit({ 2 methods: { 3 myMethod() { } 4 } 5})
Create a new stamp with a property:
1const S3 = stampit({ 2 props: { // or properties: 3 myProperty: 42 4 } 5})
Create a new stamp with a static property:
1const S4 = stampit({ 2 statics: { // or staticProperties: 3 myStaticProperty: 42 4 } 5})
Create a new stamp with initializer(s):
1const S5 = stampit({ 2 init: function () { console.log('hi form initializer') } 3}) 4// or 5const S6 = stampit({ 6 init: [ // or initializers: 7 function () { }, 8 function () { } 9 ] 10})
Create a new stamp with a configuration:
1const S7 = stampit({ 2 conf: { // or configuration: 3 myConfiguration: { anything: 'here' } 4 } 5})
Compose the stamps above together:
1const Stamp = compose(S1, S2, S3, S4, S5, S6, S7) 2console.log(Stamp) 3// { compose: [function] { properties, methods, staticProperties, initializers, configuration } } 4 5const obj = Stamp() 6console.log(obj) 7// { myProperty: 42 } 8console.log(Object.getPrototypeOf(obj)) 9// { myMethod: [function] }
See more examples in this blog post.
Static methods
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
stamp.
For example:
1stampit() 2 .props({ foo: 'foo' }) 3 .deepConf({ things: ['bar'] }) 4 .methods({ baz() {} }) 5 // etc
Shortcut exported methods
The module exports a range of shortcut methods.
These are taken from the @stamp/shortcut
stamp.
1import {methods, props, init, statics, /* etc */} from '@stamp/it'
Each returns a stampit-flavoured stamp.
NOTE! Unlike the @stamp/shortcut
module, all the exported functions of @stamp/it
are stampit-flavoured. Meaning that:
1import {methods} from '@stamp/it' 2const Stamp = methods({ foo() {} }) 3.props({bar: 1}) // THIS WILL WORK 4.statics({baz: 2}) // AND THIS WILL WORK TOO
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 4/6 approved changesets -- score normalized to 6
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 29 are checked with a SAST tool
Reason
20 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-wf5p-g6vw-rhxx
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-ghr5-ch3p-vcr6
- Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc
- Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp
- Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j
- Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22
- Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
- Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw
- Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m / GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9
Score
2.9
/10
Last Scanned on 2024-12-16
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to @stamp/it
pure-stamp
Creates an optimized pure compose function with dependencies tacked onto it for easy lib propagation.
zamanejs
ZamaneJS is a JavaScript implementation of the Zamane timestamping service. It provides a simple and easy-to-use API for interacting with the Zamane service.
@ozntel/local-storage-handler
This package will help you to set local storage items with a time stamp and retrieve them by checking how many hours ago it was set.
da-qr-watermark
An example of using the DocumentAlchemy API to generate a QR code and then stamp it on each page of a PDF as a watermark image.