Releases: clay/amphora-fs
Releases · clay/amphora-fs
Bugfix: require package.json in methods
Require package.json in the methods that need it, rather than when amphora-fs
loads. This allows consumers to run in places that don't necessarily have a package.json
file in the current working directory.
Bugfix: Exporting All Functions
Not all functions were exported from index.js file
file-stability
Official v1.0 Release
Contains methods for dealing with components, layouts, and various other utilities:
- fileExists - test if a file exists
- getComponentModule - get a component's
model.js
- getComponentName - get a component's name, validating that it exists in your Clay instance
- getComponentPackage - get a npm component's
package.json
- getComponentPath - get a component's filepath
- getComponents - get a list of all components in your Clay instance
- getFiles - get files (that aren't test or documentation) in a directory
- getFolders - get folders in a directory
- getIndices - get all component references in an object
- getLayoutModule - get a layout's
model.js
- getLayoutName - get a layout's name, validating that it exists in your Clay instance
- getLayoutPath - get a layout's filepath
- getLayouts - get a list of all layouts in your Clay instance
- getSchemaPath - get the path for a layout's / component's schema
- getYaml - get and parse yaml files, including env variables (for
config.yml
andlocal.yml
) - isDirectory - determine if a path is a directory
- readFilePromise -
fs.readFile
that returns a promise - tryRequire - attempt to
require()
a file, with graceful fallback