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

@js-bits/xpromise

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@js-bits/xpromise - npm Package Compare versions

Comparing version 0.1.3 to 0.2.0

.husky/pre-commit

2

index.js
import enumerate from '@js-bits/enumerate';
console.log(`xpromise import mode ${typeof require === 'undefined' ? 'esm' : 'cjs'}`);
// pseudo-private properties emulation in order to avoid source code transpiling

@@ -4,0 +6,0 @@ // TODO: replace with #privateField syntax when it gains wide support

7

index.test.js
/* eslint-disable max-classes-per-file */
// eslint-disable-next-line import/no-extraneous-dependencies
import { jest } from '@jest/globals';
import { cyan } from '@js-bits/log-in-color';
import ExtendablePromise from './index.js';
// import ExtendablePromise from './dist/index.cjs';
// const ExtendablePromise = require('./dist/index.cjs');
const env = cyan(`[${typeof window === 'undefined' ? 'node' : 'jsdom'}]`);
describe(`ExtendablePromise: ${env}`, () => {
describe(`ExtendablePromise`, () => {
let executorFunc;

@@ -11,0 +10,0 @@ let promise;

{
"name": "@js-bits/xpromise",
"version": "0.1.3",
"version": "0.2.0",
"description": "Extendable Promise",

@@ -13,9 +13,20 @@ "keywords": [

"type": "module",
"main": "./dist/index.cjs",
"module": "./index.js",
"exports": "./index.js",
"exports": {
".": {
"require": "./dist/index.cjs",
"default": "./index.js"
}
},
"scripts": {
"build": "rollup ./index.js --format cjs --file dist/index.cjs --exports default",
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js --verbose",
"test-cjs": "jest --verbose",
"test-coverage": "yarn test --coverage",
"test-watch": "yarn test --watch",
"lint": "eslint '**/*.{js,jsx}'"
"lint": "eslint '**/*.{js,jsx}'",
"husky:pre-commit": "npx husky add .husky/pre-commit \"yarn build\" && npx husky add .husky/pre-commit \"git add dist/**.*\" && git add .husky/pre-commit",
"husky:pre-push": "npx husky add .husky/pre-push \"yarn lint\" && npx husky add .husky/pre-push \"yarn test\" && git add .husky/pre-push",
"husky:init": "npx husky install && yarn husky:pre-commit && yarn husky:pre-push"
},

@@ -30,5 +41,7 @@ "repository": {

"@js-bits/formalinter": "^0.1.2",
"@js-bits/log-in-color": "^0.0.2",
"@js-bits/log-in-color": "^0.3.1",
"@types/jest": "^26.0.22",
"jest": "^26.6.3"
"husky": "^7.0.1",
"jest": "^26.6.3",
"rollup": "^2.55.1"
},

@@ -55,4 +68,4 @@ "engines": {

"dependencies": {
"@js-bits/enumerate": "^0.4.0"
"@js-bits/enumerate": "^0.5.1"
}
}

@@ -25,2 +25,8 @@ # Extendable Promise

or require for CommonJS:
```javascript
const ExtendablePromise = require('@js-bits/xpromise');
```
## How to use

@@ -47,3 +53,2 @@

- Does not include any polyfills, which means that Internet Explorer is not supported.
- Requires [ECMAScript modules](https://nodejs.org/api/esm.html) to be enabled in Node.js environment. Otherwise, compile into a CommonJS module.
- [Alternative solution](https://stackoverflow.com/questions/48158730/extend-javascript-promise-and-resolve-or-reject-it-inside-constructor)
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