Use a virtual file system
See original GitHub issueOn a GitHub app the file system and the cloned repo are not available. Currently cosmiconfig
browse the filesystem to find the config files, so it cannot be used with a GitHub app.
Would it be possible to pass to the load
function a Array
of file Objects
, which would contains the the file path and the file content as a String
or a Buffer
?
So a GitHub app could retrieve the config files as a String
or Buffer
and pass them to cosmiconfig
.
For example:
const explorer = cosmiconfig('mymodule', [
{path: 'mymodulerc.yml', content: '....'},
{path: 'dir/mymodulerc.yml', content: '....'},
]);
explorer.load();
// => use config from `mymodulerc.yml`
explorer.load('dir');
// => use config from `dir/mymodulerc.yml`
explorer.load(null, 'dir/mymodulerc.yml');
// => use config from `dir/mymodulerc.yml`
Issue Analytics
- State:
- Created 6 years ago
- Comments:29 (15 by maintainers)
Top Results From Across the Web
Virtual file system - Wikipedia
The purpose of a VFS is to allow client applications to access different types of concrete file systems in a uniform way. A...
Read more >Overview of the Linux Virtual File System
The Virtual File System (also known as the Virtual Filesystem Switch) is the software layer in the kernel that provides the filesystem interface...
Read more >Virtual File Systems - IBM
The virtual file system is an abstraction of a physical file system implementation. It provides a consistent interface to multiple file systems, both...
Read more >Virtual filesystems in Linux: Why we need them and how they ...
VFS are a "shim layer" between system calls and implementors of specific file_operations like ext4 and procfs . The file_operations functions ...
Read more >What is virtual file system (VFS)? | Definition from TechTarget
The VFS serves as an abstraction layer that gives applications access to different types of file systems and local and network storage devices....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@sudo-suhas Agreed. It could go into whatever release it’s ready for.
Here are the steps I see to allowing the user to pass in a custom
fs
module:isDirectory
function, instead of using theis-directory
module.fs
methods we use. That way we can document that the user-providedfs
must expose those methods.memfs
.Does that sound right?