@shun-shobon/littlexml
Advanced tools
Comparing version 0.1.2 to 0.2.0
@@ -1,4 +0,2 @@ | ||
export * from "./element.js"; | ||
export * from "./escape.js"; | ||
export * from "./render.js"; | ||
export * from "./xml.js"; | ||
export { Element, element } from "./element.js"; | ||
export { renderToString } from "./render.js"; |
@@ -6,3 +6,3 @@ { | ||
"name": "@shun-shobon/littlexml", | ||
"version": "0.1.2", | ||
"version": "0.2.0", | ||
"description": "A small and simple XML builder for JavaScript/TypeScript.", | ||
@@ -9,0 +9,0 @@ "license": "MIT", |
@@ -12,7 +12,49 @@ # littlexml | ||
- [x] Deno | ||
- [ ] Node.js | ||
- [ ] Browser | ||
- [ ] Edge | ||
- Deno | ||
- Node.js | ||
- Browser | ||
- Edge | ||
## Installation | ||
### Node.js | ||
Install package from npm. | ||
```sh | ||
npm install @shun-shobon/littlexml | ||
``` | ||
You can import from the package as `@shun-shobon/littlexml`. | ||
```ts | ||
import { element, renderToString } from "@shun-shobon/littlexml"; | ||
``` | ||
<!-- x-release-please-start-version --> | ||
### Deno | ||
You can directly import from `deno.land/x`. | ||
```ts | ||
import { | ||
element, | ||
renderToString, | ||
} from "https://deno.land/x/littlexml@0.1.2/mod.ts"; | ||
``` | ||
### Browser | ||
You can directly import from `unpkg.com`. | ||
```js | ||
import { | ||
element, | ||
renderToString, | ||
} from "https://unpkg.com/@shun-shobon/littlexml@0.1.2"; | ||
``` | ||
<!-- x-release-please-end --> | ||
## Example | ||
@@ -37,4 +79,4 @@ | ||
.child(element("image:loc").text("https://example.com/image.png")) | ||
.child(element("image:caption").text("caption")), | ||
), | ||
.child(element("image:caption").text("caption")) | ||
) | ||
); | ||
@@ -41,0 +83,0 @@ |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__exportStar(require("./element.js"), exports); | ||
__exportStar(require("./escape.js"), exports); | ||
__exportStar(require("./render.js"), exports); | ||
__exportStar(require("./xml.js"), exports); | ||
exports.renderToString = exports.element = exports.Element = void 0; | ||
var element_js_1 = require("./element.js"); | ||
Object.defineProperty(exports, "Element", { enumerable: true, get: function () { return element_js_1.Element; } }); | ||
Object.defineProperty(exports, "element", { enumerable: true, get: function () { return element_js_1.element; } }); | ||
var render_js_1 = require("./render.js"); | ||
Object.defineProperty(exports, "renderToString", { enumerable: true, get: function () { return render_js_1.renderToString; } }); |
@@ -1,4 +0,6 @@ | ||
export * from "./element.js"; | ||
export * from "./escape.js"; | ||
export * from "./render.js"; | ||
export * from "./xml.js"; | ||
export { Element, element } from "./element.js"; | ||
export type { Content } from "./element.js"; | ||
export { renderToString } from "./render.js"; | ||
export type { RenderOption } from "./render.js"; | ||
export type { IndentType } from "./util.js"; | ||
export type { XmlVersion } from "./xml.js"; |
import { type XmlVersion } from "./xml.js"; | ||
import { type Element } from "./element.js"; | ||
import { type IndentType } from "./util.js"; | ||
type RenderOption = { | ||
export type RenderOption = { | ||
version?: XmlVersion; | ||
@@ -9,2 +9,1 @@ indent?: IndentType; | ||
export declare function renderToString(root: Element, options?: RenderOption): string; | ||
export {}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16263
104
254