# ipfs-fn **Repository Path**: mirrors_mikeal/ipfs-fn ## Basic Information - **Project Name**: ipfs-fn - **Description**: Function transforms for ipfs files. - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-09 - **Last Updated**: 2025-09-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # ipfs-fn Functional transforms for ipfs files. `ipfs-fn` is a way to write repeatable transformations of ipfs files into other ipfs files. With `ipfs-fn`, a function is defined for a given route of data. That function can then create additional ipfs files. When those files are written to ipfs, meta-information is stored about the source hash that created them. If a file changes, it can be detected and the transforms run again. Transforms can be skipped when the file has already been created. If you change a transform function, you can clear the cached metadata to re-run. When any file in a directory changes, the directory hash will change and directory level functions can also be run again. ### API ```javascript let fn = require('ipfs-fn') /* operates on every file in the /gharchive/ directory */ module.exports = fn('/gharchive/', async api => { api.file // source file from ipfs let stream = await api.createFile('/gharchive/filename-meta.csv') /* The service stores meta information about the file that associates it with the current service instance including the hash, and with the source files hash. */ }) /* Directories */ module.exports = fn.dir('/gharchive/', async api => { api.files // source files from ipfs let stream = await api.createFile('/gharchive/filename-meta-summary.csv') }) ``` #### Storage - /gharchive - /.gharchive.fn/ - ${functionName} - ${desthash}.json - ${sourcehash}.json ### CLI ``` fn file.js ipfs://destination/gharchive // grabs functionName from filename. fn --force // re-runs transforms and writes new files. fn --concurrency=4 // number of transforms to run at a time. fn --clear functionName // cleans cached metadata for functionName fn --test // don't write output files, just give information about the files being written ```