Differences between segmentio/ware & unifiedsjs/unified #260
-
Hi there, I'm the maintainer of Metalsmith.js, an SSG which uses Ware.js for its plugins. Ware.js is very, very similar to unified at the surface. Whilst browsing the Ware.js history, I noticed @wooorm was a frequent contributor and wondered: was one the continuation of the other, and why not continue contributing to the first? Is unified more specialized in its use cases internally (AST's) or is that just the use case most worked on? This is important for me as I consider incorporating a fork of Ware.js in the metalsmith codebase, but if there is an equivalent or better, externally maintained option, that would be better. AFAICS both are operating-environment agnostic (browser/Node), but the For illustration of the similarity: // ware.js through Metalsmith
await Metalsmith(__dirname)
.metadata({ hostname: "https://example.com/" })
.use(collections({ posts: 'posts/*.md' }))
.use(markdown())
.use(permalinks())
.use(layouts({ transform: 'nunjucks', pattern: '**/*.html' }))
.process() // unified
await unified()
.data('hostname', 'https://example.com/')
.use(remarkParse)
.use(remarkPresetLintMarkdownStyleGuide)
.use(remarkRetext, unified().use(retextEnglish).use(retextEquality))
.use(remarkRehype)
.use(rehypeStringify)
.process(input) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
Isn't |
Beta Was this translation helpful? Give feedback.
-
Unified has a rewrite that has been stable for a while https://github.com/wooorm/trough Which is fully typescript checked (using jsdoc mode), has full support for ESM, come complete and modern testing. |
Beta Was this translation helpful? Give feedback.
Unified is more focused (at a types level) on handling syntax trees. (https://github.com/syntax-tree/unist)
And is optimized to process one file at a time.
https://github.com/wooorm/trough is more generic for creating any kind of plugin system.