Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
adjust-engine
Advanced tools
Position an element relative to another element. This repository is the workhorse behind adjust.
npm install adjust-engine
adjust = Adjust(options)
Initialize an adjustment. Supports the following options:
left top
right bottom
center middle
10% 16% (x y)
target (string): Alignment point of the target (or host) element. Supports same CSS style adjustments as attachment
.
offset (object): Specify an offset to apply to the attachment element:
x: 10
y: -10
true
. Automatically flip the element if the adjustment causes the attachment to be out of viewport. You should specify a viewport_position
for flip to work properly.adjust(attachment_position, target_position, [ viewport_position ])
Get a position of where the attachment should be. Here's a full example:
var adjust = Adjust({
attachment: 'center middle',
target: 'center middle'
});
var attachment = {
height: 50,
width: 50
}
var target = {
top: 0,
left: 0,
right: 100,
bottom: 100
}
var position = adjust(attachment, target)
assert.deepEqual(position, {
top: 25,
left: 25,
width: 50,
height: 50,
right: 75,
bottom: 75
})
make test
MIT
FAQs
adjust an element relative to another element
The npm package adjust-engine receives a total of 12 weekly downloads. As such, adjust-engine popularity was classified as not popular.
We found that adjust-engine demonstrated a not healthy version release cadence and project activity because the last version was released 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.