No description, website, or topics provided.
JavaScript
Permalink
Failed to load latest commit information.
bin Move parsing into UserStoryParser Feb 13, 2014
example
lib UserStory without underscore Jan 30, 2015
specs
.gitignore
.travis.yml
LICENSE Prepare for publication Feb 9, 2014
README.md
bower.json Bump version 0.0.8 Mar 24, 2014
package.json UserStory without underscore Jan 30, 2015

README.md

Build Status Coverage Status

NPM

UserStory v0.0.10 — client-side logger

gulp-user-story

grunt-user-story

Installation

Install backend && frontend

npm install user-story
bower install UserStory

Format logs

... // Message @foo
... // Message @foo @foo.bar @baz
... // Message [x] @foo
... // Message [`x] @foo

The last two examples show how to display variable, the last example displays the variables in the JSON.

Parse scripts

cat input.js | ./node_modules/user-story/bin/us > output.js

Include client-side part

<script type="text/javascript" src="underscore.js"></script>
<script type="text/javascript" src="UserStory.js"></script>
<script type="text/javascript" src="output.js"></script>

Usage

Configure UserStory after script loading:

<script type="text/javascript" src="bower_components/UserStory/lib/UserStory.js"></script>
<script type="text/javascript">
    UserStory.configure({
        on: ['*'],
        off: ['foo.bar'],
        logger: function (message, section){
            console.log('My custom log', message, section);
        }
    });
</script>

or type in console:

UserStory.on('*');
UserStory.off('foo.bar');
UserStory.reset();
UserStory.only('foo.bar'); // Equivalent of UserStory.reset(); UserStory.on('foo.bar');

Пост про UserStory.js