
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Simple Promise-based replacement of native Alert, Confirm and Prompt.
npm i smalltalk
First things first, require smalltalk with:
import * as smalltalk from 'smalltalk';
You can also use native version with:
import * as smalltalk from 'smalltalk/native';
When you need a bundled verseion use
import smalltalk from 'smalltalk/bundle';
In every method of smalltalk last parameter options is optional and could be used
to prevent handling of cancel event and to specify custom button label.
({
cancel: true, /* default */
});

smalltalk
.alert('Error', 'There was an error!')
.then(() => {
console.log('ok');
});

smalltalk
.confirm('Question', 'Are you sure?')
.then(() => {
console.log('yes');
})
.catch(() => {
console.log('no');
});

smalltalk
.prompt('Question', 'How old are you?', '10')
.then((value) => {
console.log(value);
})
.catch(() => {
console.log('cancel');
});
Use type='password' for password fields:
smalltalk
.prompt('Question', 'How old are you?', '10', {
type: 'password',
})
.then((value) => {
console.log(value);
})
.catch(() => {
console.log('cancel');
});

const progress = smalltalk.progress('Cloud Commander', 'Copy /home/coderaiser -> /home/coderaiser/2');
progress
.setProgress(41)
.catch(() => {
console.log('abort');
});
You can use custom label passing into options param the buttons specification. For example :
const {tryToCatch} = require('try-to-catch');
const OK = 2;
const result = await tryToCatch(smalltalk.confirm, 'Question', 'Are you sure?', {
buttons: {
ok: 'Ok Label',
cancel: 'Cancel Label',
},
});
if (result.length === OK)
console.log('yes');
else
console.log('no');
MIT
FAQs
Promise-based Alert, Confirm and Prompt replacement
The npm package smalltalk receives a total of 3,745 weekly downloads. As such, smalltalk popularity was classified as popular.
We found that smalltalk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.