Safe Haskell | None |
---|---|
Language | Haskell2010 |
They are documented on https://docs.npmjs.com/files/package.json and have a few gotchas. Luckily plain JSON, but the interpretation of certain fields is non-trivial (since they contain a lot of “sugar”).
- newtype LoggingPackage = LoggingPackage {
- unLoggingPackage :: (Package, [Warning])
- decode :: ByteString -> Either Text LoggingPackage
- data Warning
- = WrongType { }
- | PlainWarning Text
- formatWarning :: Warning -> Text
- data Package = Package {}
- data Bin
- data Man = ManFiles (HashMap Text FilePath)
- type Dependencies = HashMap Text Text
Parsing package.json
newtype LoggingPackage Source #
LoggingPackage | |
|
FromJSON LoggingPackage Source # | See https://github.com/npm/normalize-package-data for normalization steps used by npm itself. |
decode :: ByteString -> Either Text LoggingPackage Source #
Convenience decoding function.
Possible warnings from parsing.
formatWarning :: Warning -> Text Source #
Convert a package.json
parsing warning to plain text.
package.json
data
npm `package.json`. Not complete.
The package’s executable files.