@fnet/filemap helps you map and process files from various sources into a target directory. It streamlines fetching, organizing, and optionally transforming content from local paths and remote sources. Perfect for build processes, deployment pipelines, and configuration management.
Provide a list of sources and a target. The tool gathers content from each source, optionally renders it via a template engine when context is provided, and outputs either to files, to the console, or as JSON. Use protocol syntax (file://, http://, text://, json://, archive://) for cleaner configurations.
- Multiple sources: local files, HTTP/HTTPS, inline text/JSON, archives
- Protocol syntax:
file://,http://,https://,text://,json://,archive:// - Archive extraction: ZIP, TAR, TAR.GZ with zero dependencies
- Template rendering: Nunjucks and Handlebars with context variables
- Symlink support: cross-platform file and directory symlinks
- Flexible outputs: file, stdout, or JSON
- Performance-optimized: direct copy when templating is disabled
- Nested directories: preserves deep directory structures
- Target override: rename files during mapping
For detailed examples, API reference, and best practices, see fnet/how-to.md.
@fnet/filemap simplifies managing files from diverse sources so you can focus on your workflow. Whether you're working with local files, remote URLs, or inline content, it makes mapping and processing straightforward and reliable.