bower-json-0.5.0.0: Read bower.json from Haskell

Safe HaskellNone
LanguageHaskell2010

Web.Bower.PackageMeta

Contents

Description

A data type representing the Bower.json package description file, together with a parser and related functions.

This code is based on the specification at https://github.com/bower/bower.json-spec.

Synopsis

Data types

data PackageMeta Source

A data type representing the data stored in a bower.json package manifest file.

Note that the ToJSON / FromJSON instances don't exactly match; for example, it is not always the case that decoding from JSON and then encoding to JSON will give you the exact same JSON that you started with. However, if you start with a PackageMeta value, encode to JSON, and then decode, you should always get the same value back.

data PackageName Source

A valid package name for a Bower package.

mkPackageName :: String -> Either PackageNameError PackageName Source

A smart constructor for a PackageName. It ensures that the package name satisfies the restrictions described at https://github.com/bower/bower.json-spec#name.

Parsing

decodeFile :: FilePath -> IO (Either (ParseError BowerError) PackageMeta) Source

Read and attempt to decode a bower.json file.

asPackageMeta :: Parse BowerError PackageMeta Source

A parser for bower.json files, using the aeson-better-errors package.