winston-fms-transport
Version:
A transport to support logging via winston to FileMaker Server
141 lines (103 loc) • 6.22 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Home - Documentation</title>
<script src="scripts/prettify/prettify.js"></script>
<script src="scripts/prettify/lang-css.js"></script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<label for="nav-trigger" class="navicon-button x">
<div class="navicon"></div>
</label>
<label for="nav-trigger" class="overlay"></label>
<nav>
<li class="nav-link nav-home-link"><a href="index.html">Home</a></li>
</nav>
<div id="main">
<section class="readme">
<article><h1>winston-fms-transport <a href="https://travis-ci.org/Luidog/winston-fms-transport"><img src="https://travis-ci.org/Luidog/winston-fms-transport.png?branch=master" alt="Build Status"></a></h1><p>A transport to support logging via winston to FileMaker Server.</p>
<h2>Installation</h2><p>This is a <a href="https://nodejs.org/">Node.js</a> module available through the
<a href="https://www.npmjs.com/">npm registry</a>. It can be installed using the
<a href="https://docs.npmjs.com/getting-started/installing-npm-packages-locally"><code>npm</code></a>
or
<a href="https://yarnpkg.com/en/"><code>yarn</code></a>
command line tools.</p>
<pre class="prettyprint source lang-sh"><code>npm install winston-fms-transport --save</code></pre><h2>Usage</h2><pre class="prettyprint source lang-js"><code>'use strict';
const { connect } = require('marpat');
const { createLogger } = require('winston');
const environment = require('dotenv');
const varium = require('varium');
const { FilemakerTransport } = require('./index.js');
environment.config({ path: './tests/.env' });
varium(process.env, './tests/env.manifest');
connect('nedb://memory')
.then(db => {
const filemakerTransport = level =>
new FilemakerTransport({
application: process.env.APPLICATION,
server: process.env.SERVER,
user: process.env.USERNAME,
password: process.env.PASSWORD,
level: level,
infoField: 'info',
messageField: 'message',
layout: process.env.LAYOUT
});
const logger = createLogger({
transports: [filemakerTransport('silly')],
exitOnError: false
});
logger.emitErrs = true;
return logger;
})
.then(logger => logger.info('Message', { db: 'this is a message' }));</code></pre><h2>Tests</h2><pre class="prettyprint source lang-sh"><code>npm install
npm test</code></pre><pre class="prettyprint source"><code>> winston-fms-transport@0.0.1 test /Users/luidelaparra/Documents/Development/winston-fms-transport
> nyc _mocha --recursive ./tests --timeout=30000
----------|----------|----------|----------|----------|-------------------|
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
----------|----------|----------|----------|----------|-------------------|
All files | 0 | 0 | 0 | 0 | |
----------|----------|----------|----------|----------|-------------------|</code></pre><h2>Dependencies</h2><ul>
<li><a href="https://ghub.io/fms-api-client">fms-api-client</a>: A FileMaker Data API client designed to allow easier interaction with a FileMaker application from a web environment.</li>
<li><a href="https://ghub.io/marpat">marpat</a>: A class-based ES6 ODM for Mongo-like databases.</li>
<li><a href="https://ghub.io/transport">transport</a>: a hub for centralizing all your request handlers within your application</li>
<li><a href="https://ghub.io/winston">winston</a>: A multi-transport async logging library for Node.js</li>
</ul>
<h2>Dev Dependencies</h2><ul>
<li><a href="https://ghub.io/chai">chai</a>: BDD/TDD assertion library for node.js and the browser. Test framework agnostic.</li>
<li><a href="https://ghub.io/chai-as-promised">chai-as-promised</a>: Extends Chai with assertions about promises.</li>
<li><a href="https://ghub.io/coveralls">coveralls</a>: takes json-cov output into stdin and POSTs to coveralls.io</li>
<li><a href="https://ghub.io/dotenv">dotenv</a>: Loads environment variables from .env file</li>
<li><a href="https://ghub.io/eslint">eslint</a>: An AST-based pattern checker for JavaScript.</li>
<li><a href="https://ghub.io/eslint-config-google">eslint-config-google</a>: ESLint shareable config for the Google style</li>
<li><a href="https://ghub.io/eslint-config-prettier">eslint-config-prettier</a>: Turns off all rules that are unnecessary or might conflict with Prettier.</li>
<li><a href="https://ghub.io/eslint-plugin-prettier">eslint-plugin-prettier</a>: Runs prettier as an eslint rule</li>
<li><a href="https://ghub.io/jsdocs">jsdocs</a>: jsdocs</li>
<li><a href="https://ghub.io/minami">minami</a>: Clean and minimal JSDoc 3 Template / Theme</li>
<li><a href="https://ghub.io/mocha">mocha</a>: simple, flexible, fun test framework</li>
<li><a href="https://ghub.io/mocha-lcov-reporter">mocha-lcov-reporter</a>: LCOV reporter for Mocha</li>
<li><a href="https://ghub.io/nyc">nyc</a>: the Istanbul command line interface</li>
<li><a href="https://ghub.io/package-json-to-readme">package-json-to-readme</a>: Generate a README.md from package.json contents</li>
<li><a href="https://ghub.io/prettier">prettier</a>: Prettier is an opinionated code formatter</li>
<li><a href="https://ghub.io/varium">varium</a>: A strict parser and validator of environment config variables</li>
</ul>
<h2>License</h2><p>MIT</p></article>
</section>
</div>
<br class="clear">
<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri May 25 2018 19:29:01 GMT-0700 (PDT) using the Minami theme.
</footer>
<script>prettyPrint();</script>
<script src="scripts/linenumber.js"></script>
</body>
</html>