-
Notifications
You must be signed in to change notification settings - Fork 0
API v1
- Classes
- Constants
- Typedefs
- LogWrapper
- MdWriter
- Md
- PkgReader
- PkgToMd
- UTF8 :
string - DEFAULT_MD_FILE :
string - DEFAULT_PKG_FILE :
string - DEFAULT_REGISTRY :
string - DEPENDENCY_TYPE_PROD :
string - DEPENDENCY_TYPE_DEV :
string - DEPENDENCY_TYPE_BUNDLED :
string - DEPENDENCY_TYPE_OPTIONAL :
string - DEPENDENCY_TYPE_PEER :
string - Options :
object
- LogWrapper
-
Class which defines a
loggerwrapper usable in this module.NOTE: This class is not to be intended to be called from outside this module!
- MdWriter
-
Class which writes Markdown file.
- Md
-
Utility class which wraps a Markdown string and provides useful operations on this string.
- PkgReader
-
Class which reads an validates (by JSON schema) a package.json file.
- PkgToMd
-
Class which converts a package.json to a MD file.
-
UTF8 :
string -
The 'utf8' constant.
-
DEFAULT_MD_FILE :
string -
The default Markdown file: 'README.md'.
-
DEFAULT_PKG_FILE :
string -
The default package file: 'package.json'.
-
DEFAULT_REGISTRY :
string -
The default registry: 'https://registry.npmjs.org/'.
-
DEPENDENCY_TYPE_PROD :
string -
The production dependency type: ''.
-
DEPENDENCY_TYPE_DEV :
string -
The development dependency type: 'dev'.
-
DEPENDENCY_TYPE_BUNDLED :
string -
The bundled dependency type: 'bundled'.
-
DEPENDENCY_TYPE_OPTIONAL :
string -
The optional dependency type: 'optional'.
-
DEPENDENCY_TYPE_PEER :
string -
The peer dependency type: 'peer'.
-
Options :
object
Class which defines a logger wrapper usable in this module.
NOTE: This class is not to be intended to be called from outside this module!
Kind: global class
Constructs the LogWrapper.
Returns: LogWrapper - - The instance.
| Param | Type | Default | Description |
|---|---|---|---|
| [logger] |
logger | cli | console
|
console |
Logger object. |
Example
var logger = ...;
var logWrapper = new LogWrapper(logger);Log the options with INFO level.
Kind: instance method of LogWrapper
Access: public
| Param | Type | Description |
|---|---|---|
| msg | string |
The message to log. |
Example
var logger = ...;
var logWrapper = new LogWrapper(logger);
var msg = '...';
logWrapper.info(msg);Log the options with DEBUG level (if logger supports it, else with INFO).
Kind: instance method of LogWrapper
Access: public
| Param | Type | Description |
|---|---|---|
| msg | string |
The message to log. |
Example
var logger = ...;
var logWrapper = new LogWrapper(logger);
var msg = '...';
logWrapper.debug(msg);Log the options with TRACE level (if logger supports it, else with DEBUG).
Kind: instance method of LogWrapper
Access: public
See: #debug
| Param | Type | Description |
|---|---|---|
| msg | string |
The message to log. |
Example
var logger = ...;
var logWrapper = new LogWrapper(logger);
var msg = '...';
logWrapper.trace(msg);Log the options with ERROR level.
Kind: instance method of LogWrapper
Access: public
| Param | Type | Description |
|---|---|---|
| msg | string |
The message to log. |
Example
var logger = ...;
var logWrapper = new LogWrapper(logger);
var msg = '...';
logWrapper.error(msg);Log the options with INFO level.
Kind: instance method of LogWrapper
Returns: A Promise containing the passed options object.
Access: public
| Param | Type | Description |
|---|---|---|
| options | Options |
The properties to log with INFO. |
Example
var logger = ...;
var logWrapper = new LogWrapper(logger);
var options = {
...
};
logWrapper.verboseOptions(options)
.then(function (options) {
...
});Class which writes Markdown file.
Kind: global class
-
MdWriter
- new MdWriter()
-
.write(md, options) ⇒
bluebird|exports|module.exports
Constructs the writer.
Returns: MdWriter - - The instance.
Kind: instance method of MdWriter
Access: public
| Param |
|---|
| md |
| options |
Utility class which wraps a Markdown string and provides useful operations on this string.
Kind: global class
Constructs the Markdown string from given package object.
Returns: Md - - The instance.
| Param | Type | Description |
|---|---|---|
| pkg | object |
- |
| options | object |
- |
| logger | logger |
- |
md.append(content, [amount]) ⇒ Md
Appends the given content to the Markdown string and adds newlines.
Kind: instance method of Md
Returns: Md - - This instance for concatenated calls.
Access: public
| Param | Type | Default | Description |
|---|---|---|---|
| content | string |
The content to append. | |
| [amount] | number |
2 |
The amount of newlines to add. |
md.nl([amount]) ⇒ Md
Adds newlines of the given amount.
Kind: instance method of Md
Returns: Md - - This instance for concatenated calls.
Access: public
| Param | Type | Default | Description |
|---|---|---|---|
| [amount] | number |
2 |
The amount of newlines to add. |
Returns the Markdown string (optionally adds newlines).
Kind: instance method of Md
| Param | Type | Description |
|---|---|---|
| [amount] | number |
The final amount of newlines. |
Class which reads an validates (by JSON schema) a package.json file.
Kind: global class
-
PkgReader
- new PkgReader()
-
.read(options) ⇒
Promise.<T>
Constructs the constants.
Returns: PkgReader - - The instance.
Kind: instance method of PkgReader
| Param |
|---|
| options |
Class which converts a package.json to a MD file.
Kind: global class
-
PkgToMd
- new PkgToMd()
-
.writeMarkdown(options) ⇒
Promise
Constructs the ....
Returns: PkgToMd - - The instance.
Kind: instance method of PkgToMd
Returns: Promise - -
| Param |
|---|
| options |
The 'utf8' constant.
Kind: global constant
Access: public
The default Markdown file: 'README.md'.
Kind: global constant
Access: public
The default package file: 'package.json'.
Kind: global constant
Access: public
The default registry: 'https://registry.npmjs.org/'.
Kind: global constant
Access: public
The production dependency type: ''.
Kind: global constant
Access: public
The development dependency type: 'dev'.
Kind: global constant
Access: public
The bundled dependency type: 'bundled'.
Kind: global constant
Access: public
The optional dependency type: 'optional'.
Kind: global constant
Access: public
The peer dependency type: 'peer'.
Kind: global constant
Access: public
Kind: global typedef
Properties
| Name | Type | Default | Description |
|---|---|---|---|
| origin | string |
"yaml" |
The origin type. |
| target | string |
"js" |
The target type. |
| src |
string | Readable | object
|
The source. | |
| dest |
string | Writable | object
|
The destination. | |
| indent | number |
4 |
The indention in files. |
| imports | string |
The exports name for reading from JS source file or objects only. | |
| exports | string |
The exports name for usage in JS destination files only. |