
Security News
Scaling Socket from Zero to 10,000+ Organizations
Socket CEO Feross Aboukhadijeh shares lessons from scaling a developer security startup to 10,000+ organizations in this founder interview.
@enonic-types/lib-admin
Advanced tools
TypeScript definitions for
lib-adminlibrary of Enonic XP
npm i --save-dev @enonic-types/lib-admin
To make require work out of the box, you must install and add the @enonic-types/global types. Aside from providing definitions for XP
global objects, e.g. log, app, __, etc, requiring a library by the default path will return typed object.
tsconfig.json
{
"compilerOptions": {
"types": [
"@enonic-types/global"
]
}
}
example.ts
const {getBaseUri, getAssetsUri, getHomeToolUrl, HomeToolUrlType} = require('/lib/xp/admin');
More detailed explanation on how it works and how to type custom import function can be found here.
If you are planning to use import in your code and transpile it with the default tsc TypeScript compiler, you'll need to add proper
types mapping to your configuration.
tsconfig.json
{
"compilerOptions": {
"baseUrl": "./",
"paths": {
"/lib/xp/admin": ["node_modules/@enonic-types/lib-admin"]
}
}
}
example.ts
import {getBaseUri, getAssetsUri, getHomeToolUrl, HomeToolUrlType} from '/lib/xp/admin';
Setting baseUrl and paths will allow the tsc to keep the valid paths in the resulting JavaScript files.
FAQs
Type definitions for lib-admin.
The npm package @enonic-types/lib-admin receives a total of 575 weekly downloads. As such, @enonic-types/lib-admin popularity was classified as not popular.
We found that @enonic-types/lib-admin 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
Socket CEO Feross Aboukhadijeh shares lessons from scaling a developer security startup to 10,000+ organizations in this founder interview.

Research
Socket Threat Research maps a rare inside look at OtterCookie’s npm-Vercel-GitHub chain, adding 197 malicious packages and evidence of North Korean operators.

Research
Socket researchers identified a malicious Chrome extension that manipulates Raydium swaps to inject an undisclosed SOL transfer, quietly routing fees to an attacker wallet.