
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.
sonolus-express
Advanced tools
TypeScript based developer toolkit for Sonolus servers with Express.js
TypeScript based developer toolkit for Sonolus servers with Express.js.
npm install sonolus-express
A compatible version of sonolus-core is also required as peer dependency. If it isn't installed automatically, you can do so with:
npm install sonolus-core
const port = 3000
const app = express()
new Sonolus(app).load('pack')
app.listen(port, () => {
console.log('Server listening at port', port)
})
Sonolusconstructor(app, options)Create a Sonolus server on app with options.
app: Express.js app.options.basePath: base path of the Sonolus server (should not have ending /).options.authentication: if Sonolus server requires authentication.options.sessionAddress: session address to be used in authentication.options.sessionDuration: session duration to be used in authentication.options.fallbackLocale: fallback locale when user's preferred locale cannot be used.options.mode: share link handling mode, can be custom, redirect, or spa.options.spaRoot: root of static SPA files to serve when options.mode is spa.options.levels: configurations for levels.options.skins: configurations for skins.options.backgrounds: configurations for backgrounds.options.effects: configurations for effects.options.particles: configurations for particles.options.engines: configurations for engines.sessionAddressSession address. As passed in from constructor(app, options).
routerExpress router.
Installing more routes under options.basePath may not work due to SPA mode catch all routes. Instead install onto router rather than the original Express app.
dbSonolus database. Can be modified to dynamically add/remove/reorder items.
db.levels: levels.db.skins: skins.db.backgrounds: backgrounds.db.effects: effects.db.particles: particles.db.engines: engines.load(path)Load a pack created by sonolus-pack.
path: file path to the pack.add(type, data, hash?)Add a resource. Returns SRL which can be used to access the resource.
type: resource type.data: data (Buffer) or file path (string) to the data.hash: (optional) hash of the resource, will be calculated automatically when omitted.localize(text, locale)Localize text using target and fallback locales.
text: text to localize.locale: target locale.createSessionHandlerHandler for creating an authentication session.
findSessionHandlerHandler for finding an authentication session.
checkSessionHandlerHandler for checking an authentication session.
serverInfoHandlerHandler for requesting server info. Defaults to defaultServerInfoHandler.
levelListHandlerHandler for requesting level list. Defaults to defaultLevelListHandler.
skinListHandlerHandler for requesting skin list. Defaults to defaultSkinListHandler.
backgroundListHandlerHandler for requesting background list. Defaults to defaultBackgroundListHandler.
effectListHandlerHandler for requesting effect list. Defaults to defaultEffectListHandler.
particleListHandlerHandler for requesting particle list. Defaults to defaultParticleListHandler.
engineListHandlerHandler for requesting engine list. Defaults to defaultEngineListHandler.
levelDetailsHandlerHandler for requesting level details. Defaults to defaultLevelDetailsHandler.
skinDetailsHandlerHandler for requesting skin details. Defaults to defaultSkinDetailsHandler.
backgroundDetailsHandlerHandler for requesting background details. Defaults to defaultBackgroundDetailsHandler.
effectDetailsHandlerHandler for requesting effect details. Defaults to defaultEffectDetailsHandler.
particleDetailsHandlerHandler for requesting particle details. Defaults to defaultParticleDetailsHandler.
engineDetailsHandlerHandler for requesting engine details. Defaults to defaultEngineDetailsHandler.
filterLevelInfosByKeywords(infos, keywords)Filter level infos by keywords on name, rating, title, artists, author, and description.
infos: level infos.keywords: keywords.filterSkinInfosByKeywords(infos, keywords)Filter skin infos by keywords on name, title, subtitle, author, and description.
infos: skin infos.keywords: keywords.filterBackgroundInfosByKeywords(infos, keywords)Filter background infos by keywords on name, title, subtitle, author, and description.
infos: background infos.keywords: keywords.filterEffectInfosByKeywords(infos, keywords)Filter effect infos by keywords on name, title, subtitle, author, and description.
infos: effect infos.keywords: keywords.filterParticleInfosByKeywords(infos, keywords)Filter particle infos by keywords on name, title, subtitle, author, and description.
infos: particle infos.keywords: keywords.filterEngineInfosByKeywords(infos, keywords)Filter engine infos by keywords on name, title, subtitle, author, and description.
infos: engine infos.keywords: keywords.filterInfosByKeywords(infos, props, keywords)Filter item infos by keywords on specified props.
Recommended to use functions for the specific info type instead.
infos: item infos.props: props to filter keywords on.keywords: keywords.paginateInfos(infos, page, perPage)Paginate item infos by page and per page size.
infos: item infos.page: page.perPage: per page size, defaults to 20.meta in TypeScriptUse declaration merging:
declare module 'sonolus-core' {
interface LevelInfo {
meta: {
// user-defined meta information
}
}
}
FAQs
TypeScript based developer toolkit for Sonolus servers with Express.js
The npm package sonolus-express receives a total of 9 weekly downloads. As such, sonolus-express popularity was classified as not popular.
We found that sonolus-express 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
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.