
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
@casual-simulation/aux-common
Advanced tools
A library that contains common operations needed to modify and understand AUX files.
$ npm install @casual-simulation/aux-common
import {
    createBot,
    createCalculationContext,
    calculateFormulaValue,
} from '@casual-simulation/aux-common';
const file1 = createBot('test1', {
    quantity: 10,
});
const file2 = createBot('test2', {
    quantity: 5,
});
const file3 = createBot('test3', {
    quantity: 5,
});
const context = createCalculationContext([file1, file2, file3]);
const formula = '=math.sum(getBotTagValues("#quantity"))';
const result = calculateFormulaValue(context, formula);
console.log(result);
// Outputs:
// 20
import {
    createBot,
    createCalculationContext,
    calculateFormulaEvents,
} from '@casual-simulation/aux-common';
const state = {
    test1: createBot('test1', {
        quantity: 10,
    }),
    test2: createBot('test2', {
        quantity: 5,
    }),
    test3: createBot('test3', {
        quantity: 5,
    }),
};
const formula = `
    let total = math.sum(getBotTagValues("#quantity"));
    player.toast("The total is " + total);
`;
const events = calculateFormulaEvents(state, formula);
for (let event of events) {
    if (event.type === 'local') {
        if (event.name === 'show_toast') {
            console.log('[Toast]', event.message);
        }
    }
}
// Outputs:
// [Toast] The total is 5
V3.8.0
os.eraseInst(recordKeyOrName, instName, options?) function to delete insts programmatically.ai.listChatModels() function to list the available chat models that the user can use based on their subscription.os.syncConfigBotTagsToURL(tags, fullHistory?) function.
tags - The tags that should be synced to the URL.fullHistory - Whether the a history entry should be created for every change to these tags. If false, then the URL will be updated but no additional history entries will be created. If true, then each change to the parameters will create a new history entry. Defaults to true.os.remotes() list. The system now properly cleans up all remote device registrations when a connection is lost and prevents registering the current connection as a remote.from position values in onDrag, onDrop, onAnyBotDrag, and onAnyBotDrop events were being incorrectly rounded to integers, causing non-integer bot positions (e.g., 0.5, 0.4) to be rounded before being passed to event handlers.FAQs
Common library for AUX projects
The npm package @casual-simulation/aux-common receives a total of 326 weekly downloads. As such, @casual-simulation/aux-common popularity was classified as not popular.
We found that @casual-simulation/aux-common demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.