bower.json from Haskell
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/Web/Bower
test-resources
test
.gitignore
.travis.yml
LICENSE
README.md
Setup.hs
bower-json.cabal
stack-lts-2.yaml
stack.yaml

README.md

bower-json

A package that provides a data type and functions for working with bower.json package manifest files.

Example usage:

{-# LANGUAGE OverloadedStrings #-}
import System.IO
import System.Exit
import qualified Data.Text as T
import qualified Data.Text.IO as T

import Web.Bower.PackageMeta

main = do
  ePkgMeta <- decodeFile "bower.json"
  case ePkgMeta of
    Right pkgMeta ->
      if bowerPrivate pkgMeta
        then T.hPutStrLn stderr "error: package is private" >> exitFailure
        else putStrLn (runPackageName (bowerName pkgMeta))
    Left err -> do
      T.hPutStrLn stderr ("error: failed to parse bower.json: " `T.append` displayError err)
      exitFailure

See the documentation on Hackage for more details.