
Security News
Socket Releases Free Certified Patches for Critical vm2 Sandbox Escape
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.
@xylabs/sdk-meta
Advanced tools
Base functionality used throughout XYO TypeScript/JavaScript libraries
Using npm:
npm install {{name}}
Using yarn:
yarn add {{name}}
Using pnpm:
pnpm add {{name}}
Using bun:
bun add {{name}}
See the LICENSE file for license rights and limitations (LGPL-3.0-only).
### .temp-typedoc
### functions
### <a id="addMetaToHead"></a>addMetaToHead
function addMetaToHead(
$,
name,
value): void;
Adds or replaces a meta tag in the document head.
CheerioAPI
The Cheerio API instance for the document.
string
The meta property name.
string | object
The meta content value (string, array, or nested object).
void
### <a id="getMetaAsDict"></a>getMetaAsDict
function getMetaAsDict(obj, parentKey?): Record<string, string>;
Recursively flattens a nested meta object into a flat dictionary with colon-delimited keys.
The nested object to flatten.
string
The accumulated key prefix from parent levels.
Record<string, string>
A flat record mapping colon-delimited property names to string values.
### <a id="mergeDocumentHead"></a>mergeDocumentHead
function mergeDocumentHead(destination, source): string;
Merges meta tags from the source HTML head into the destination HTML head. Existing meta tags with matching property attributes are replaced; others are appended.
string
The base HTML string to merge into.
string
The HTML string whose head meta tags will be merged.
string
The merged HTML string.
### <a id="metaBuilder"></a>metaBuilder
function metaBuilder(
html,
meta,
handler?): string;
Injects meta properties, title, and description into an HTML string.
string
The base HTML string to modify.
The metadata to inject.
string
Optional meta-handler property value to include.
string
The modified HTML string with injected metadata.
### interfaces
### <a id="Meta"></a>Meta
Represents page metadata including Open Graph and Twitter card properties.
optional description?: string;
optional og?: OpenGraphMeta;
optional title?: string;
optional twitter?: TwitterMeta;
### <a id="OpenGraphMeta"></a>OpenGraphMeta
Open Graph protocol metadata for rich link previews.
optional audio?: OpenGraphStructuredProperty;
optional description?: string;
optional determiner?: string;
optional image?: OpenGraphStructuredProperty;
optional locale?: string | string[];
optional site_name?: string;
optional title?: string;
optional type?: string;
optional url?: string;
optional video?: OpenGraphStructuredProperty;
### <a id="OpenGraphStructured"></a>OpenGraphStructured
Structured properties for an Open Graph media object (image, video, or audio).
optional ?: string;
optional alt?: string;
optional height?: number;
optional secure_url?: string;
optional type?: string;
optional url?: string;
optional width?: number;
### <a id="TwitterApp"></a>TwitterApp
Twitter App Card metadata containing app store identifiers, names, and URLs per platform.
optional id?: object;
optional googleplay?: string;
optional ipad?: string;
optional iphone?: string;
optional name?: object;
optional googleplay?: string;
optional ipad?: string;
optional iphone?: string;
optional url?: object;
optional googleplay?: string;
optional ipad?: string;
optional iphone?: string;
### <a id="TwitterMeta"></a>TwitterMeta
https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/markup
optional app?: TwitterApp;
optional card?: "summary" | "summary_large_image" | "app" | "player";
The card type. Used with all cards. Fallback: og:type. If an og:type, og:title and og:description exist in the markup but twitter:card is absent, then a summary card may be rendered.
optional creator?: object;
optional ?: string;
The
of content creator. Used with summary_large_image cards
optional id?: string;
Twitter user ID of content creator. Used with summary, summary_large_image cards
optional description?: string;
Description of content (maximum 200 characters). Used with summary, summary_large_image, player cards. Fallback: og:description.
optional image?: object;
optional ?: string;
URL of image to use in the card. Images must be less than 5MB in size. JPG, PNG, WEBP and GIF formats are supported. Only the first frame of an animated GIF will be used. SVG is not supported. Used with summary, summary_large_image, player cards. Fallback: og:image
optional alt?: string;
A text description of the image conveying the essential nature of an image to users who are visually impaired. Maximum 420 characters. Used with summary, summary_large_image, player cards
optional player?: TwitterPlayer;
optional site?: object;
The
optional ?: string;
optional id?: string;
Same as twitter:site, but the user’s Twitter ID. Either twitter:site or twitter:site:id is required. Used with summary, summary_large_image, player cards
of website. Either twitter:site or twitter:site:id is required. Used with summary, summary_large_image, app, player cards
optional title?: string;
Title of content (max 70 characters). Used with summary, summary_large_image, player cards. Fallback: og:title.
### <a id="TwitterPlayer"></a>TwitterPlayer
https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/player-card
: string;
HTTPS URL to iFrame player. This must be a HTTPS URL which does not generate active mixed content warnings in a web browser. The audio or video player must not require plugins such as Adobe Flash.
optional height?: number;
Height of iframe in pixels. Used with player card
optional stream?: string;
URL to raw video or audio stream. Used with player card
optional width?: number;
Width of iframe in pixels. Used with player card
### type-aliases
### <a id="OpenGraphStructuredProperty"></a>OpenGraphStructuredProperty
type OpenGraphStructuredProperty =
| string
| OpenGraphStructured
| (string | OpenGraphStructured)[];
A structured Open Graph property value: a URL string, a structured object, or an array of either.
### <a id="StringIndexable"></a>StringIndexable
type StringIndexable = Record<string, any>;
An object with string keys and arbitrary values, used for recursive meta flattening.
FAQs
Base functionality used throughout XYO TypeScript/JavaScript libraries
The npm package @xylabs/sdk-meta receives a total of 533 weekly downloads. As such, @xylabs/sdk-meta popularity was classified as not popular.
We found that @xylabs/sdk-meta demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 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
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.

Research
Five malicious NuGet packages impersonate Chinese .NET libraries to deploy a stealer targeting browser credentials, crypto wallets, SSH keys, and local files.

Security News
pnpm 11 turns on a 1-day Minimum Release Age and blocks exotic subdeps by default, adding safeguards against fast-moving supply chain attacks.