
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
@types/xml
Advanced tools
npm install --save @types/xml
This package contains type definitions for xml (https://github.com/dylang/node-xml).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/xml.
// Type definitions for xml 1.0
// Project: https://github.com/dylang/node-xml
// Definitions by: Jianrong Yu <https://github.com/YuJianrong>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
declare namespace xml {
interface Option {
/**
* String used for tab, defaults to no tabs (compressed)
*/
indent?: string | undefined;
/**
* Return the result as a `stream` (default false)
*/
stream?: boolean | undefined;
/**
* Add default xml declaration (default false)
*/
declaration?:
| boolean
| {
encoding?: string | undefined;
standalone?: string | undefined;
} | undefined;
}
interface XmlAttrs {
[attr: string]: XmlAtom;
}
interface XmlDescArray {
[index: number]: { _attr: XmlAttrs } | XmlObject;
}
interface ElementObject {
push(xmlObject: XmlObject): void;
close(xmlObject?: XmlObject): void;
}
type XmlAtom = string | number | boolean | null;
type XmlDesc =
| { _attr: XmlAttrs }
| { _cdata: string }
| { _attr: XmlAttrs; _cdata: string }
| XmlAtom
| XmlAtom[]
| XmlDescArray;
type XmlObject = { [tag: string]: ElementObject | XmlDesc } | XmlDesc;
function element(...xmlObjects: XmlObject[]): ElementObject;
function Element(...xmlObjects: XmlObject[]): ElementObject;
}
declare function xml(
xmlObject: xml.XmlObject | xml.XmlObject[],
options: { stream: true; indent?: string | undefined },
): NodeJS.ReadableStream;
declare function xml(xmlObject?: xml.XmlObject | xml.XmlObject[], options?: boolean | string | xml.Option): string;
export = xml;
These definitions were written by Jianrong Yu.
FAQs
TypeScript definitions for xml
The npm package @types/xml receives a total of 56,225 weekly downloads. As such, @types/xml popularity was classified as popular.
We found that @types/xml 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
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.