1.9.0 • Published 11 months ago

@lottiefiles/relottie-stringify v1.9.0

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

relottie-stringify

npm npm bundle size npm npm

Compiler for unified. Serializes last syntax trees to LottieJSON

Use

yarn add @lottiefiles/relottie-stringify
import { unified } from 'unified';
import { visit } from 'unist-util-visit';

import type { Attribute } from '@lottiefiles/last';
import relottieParse from '@lottiefiles/relottie-parse';
import relottieStringify from '@lottiefiles/relottie-stringify';

const processor = unified().use(relottieParse).use(relottieStringify);

const tree = processor.parse('{"v":"5.5.7"}');

visit(tree, 'attribute', (node: Attribute) => {
  node.key = 'new_v';
});

const output = processor.stringify(tree);

output will equal

{"new_v":"5.5.7"}

dotLottie

You can use dotLottie.js for converting a LottieJSON into .lottie format

Security

As last properties can have expressions, and improper use of last can open you up to cross-site scripting cross-site scripting (XSS). Carefully assess each plugin and the risks involved in using them.

Contribute

Any contributions are welcome.

Acknowledgments

Legal

License © LottieFiles

1.9.0

11 months ago

1.8.0

11 months ago

1.5.0

1 year ago

1.4.0

1 year ago

1.2.0

2 years ago

1.0.2

2 years ago

1.1.0

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.3.4

2 years ago

1.0.7

2 years ago

1.3.2

2 years ago

1.0.5

2 years ago

1.3.1

2 years ago

1.2.2

2 years ago

1.0.4

2 years ago

1.3.0

2 years ago

1.2.1

2 years ago

1.0.3

2 years ago

1.0.0

2 years ago

0.0.0

2 years ago