Skip to content

Releases: clay/amphora-fs

Bugfix: require package.json in methods

14 Sep 16:49
Compare
Choose a tag to compare

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

25 Jul 19:16
Compare
Choose a tag to compare

Not all functions were exported from index.js file

file-stability

12 Jul 15:50
Compare
Choose a tag to compare

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 and local.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

Feature: readFilePromise && fileExists

16 May 12:46
Compare
Choose a tag to compare

Adds two helpers:

  • readFilePromise
  • fileExists

Thanks @yuliyv!