This PR contains a bunch of improvements and full TypeScript support. Due to numerous breaking changes the version will be bumped to v0.2.
Notable Changes
Full TypeScript support
A build system for compiling, linting, and formatting TS
Hooks for running tests and linting before commit & push
Support for both ES Modules & CommonJS
Glob support for ignorePaths
New sloc alias for running node-sloc as a CLI
A flattened structure for the object resolved from sloc(opts).
Dropped support for node <8.
Breaking changes
Dropped support for node <8.
sloc(opts) now returns null if no files matched the specified path. The previous behavior was to return an object with an empty path array and an empty sloc object: {path: [], sloc: {}}.
The returned object from sloc(opts) has no nesting anymore. It now returns a SLOCResult containing 6 fields:
Description
This PR contains a bunch of improvements and full TypeScript support. Due to numerous breaking changes the version will be bumped to v0.2.
Notable Changes
ignorePaths
sloc
alias for runningnode-sloc
as a CLIsloc(opts)
.Breaking changes
sloc(opts)
now returns null if no files matched the specified path. The previous behavior was to return an object with an emptypath
array and an emptysloc
object:{path: [], sloc: {}}
.sloc(opts)
has no nesting anymore. It now returns aSLOCResult
containing 6 fields: