<commit_before>var Noun = require('./');
var noun = new Noun();

noun
  .use(function() {
    var pkg = this.get('one');
    console.log(pkg)
    this.context.one = this.context.foo;
  })
  .use(function() {
    this.context.bbb = this.context.bar;
  })
  .use(baz({what: 'whhhhhaaaa?'}))

function baz(options) {
  return function () {
    this.set('one', 'two');
    this.context.ccc = this.context.baz;
  }
}
// console.log(noun);<commit_msg>update the examples<commit_after>'use strict';

var util = require('util');
var Noun = require('./');

/**
 * The readem shows how to create an instance of Noun,
 * this shows how to inherit `Noun`.
 */

function App(options) {
  Noun.call(this, 'app');
  this.context = {};
}
util.inherits(App, Noun);

/**
 * Add some methods to our app
 */

App.prototype.set = function(key, value) {
  this.context[key] = value;
  return this;
};

App.prototype.get = function(key) {
  return this.context[key];
};


/**
 * Usage
 *
 * Create an instance of `App`
 */

var app = new App();

/**
 * Define some plugins
 */

function foo(options) {
  return function (foo) {
    this.set('foo', options);
  }
}
function bar(options) {
  return function (foo) {
    this.set('bar', options);
  }
}
function baz(options) {
  return function (foo) {
    this.set('baz', options);
  }
}

/**
 * Run the plugins!
 */

app
  .plugin(foo({a: 'b'}))
  .plugin(bar({c: 'd'}))
  .plugin(baz({e: 'f'}))


console.log(app);
{'fraction_non_alphanumeric': 0.19569743233865372, 'fraction_numerical': 0.0, 'mean_word_length': 3.204081632653061, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6756957', 'n_tokens_mistral': 541, 'n_tokens_neox': 529, 'n_words': 123}