Catalog npm
Back to packageRELEASE DETAILS

0.1.7

npm

1tree-factory

Factory that facilitates creating 1tree instances

1treetree
Published20 Jan 2017
Direct dependencies4
Transitive dependenciesNot calculated

README

Current package documentation

1tree-factory

Basically just a thin facade over 1tree to make the use case of creating a new 1tree instance easier when you have your own adapter/plugins etc.

1tree exports a default tree that's ready to start using provided that you want to use 1tree's default underlying data structures, and also exposes some methods for creating trees that use your own adapter and/or plugins.

Most people just want to start using a tree, 1tree's default export assumes this.

However, if you want to use your own adapter, or use your own plugins but also use 1tree's base plugins, there's a bit of fiddling around. It's not difficult but doing it often gets old fast.

This module also inserts the plugins specified before 1tree's base plugins - this is to ensure that the various 1tree plugins that do things like wrap other plugins or extend them in some way will play nicely with your plugins. If you want to add your plugins after the base plugins have been added, you can always call the plugin method on the tree instance.

usage

/*
  we use the name Mtree (mojule tree) internally but the npm package name was
  taken
*/
const Mtree = require( '1tree-factory' )

/*
 create a tree using the default adapter but with some extra plugins that are
 added before the base plugins
*/
const tree1 = Mtree( plugin1, plugin2, plugin3 )

// same, but array instead of multiple args
const tree2 = Mtree( [ plugin1, plugin2, plugin3 ] )

// same, but with a custom adapter
const tree3 = Mtree( adapter, plugin1, plugin2, plugin3 )

// pass a boolean with true to exclude the base plugins
const tree4 = Mtree( plugin1, plugin2, plugin3, true )
const tree5 = Mtree( adapter, plugin1, plugin2, plugin3, true )

// add plugins after the fact, for example to wrap or extend existing plugins
tree5.plugin( plugin4 )

// same as just using 1tree
const tree6 = Mtree()

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 4

Native requirements
4 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
1tree
Environment
{
  "local_name": "1tree",
  "alias": false,
  "peer_metadata": null
}
^0.4.4runtime
babel-preset-es2015
Environment
{
  "local_name": "babel-preset-es2015",
  "alias": false,
  "peer_metadata": null
}
^6.18.0development
gulp
Environment
{
  "local_name": "gulp",
  "alias": false,
  "peer_metadata": null
}
^3.9.1development
gulp-babel
Environment
{
  "local_name": "gulp-babel",
  "alias": false,
  "peer_metadata": null
}
^6.1.2development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "3ebf3b7e2eafd9e3e66b747c26453f3ecb189110",
  "tarball": "https://registry.npmjs.org/1tree-factory/-/1tree-factory-0.1.7.tgz",
  "integrity": "sha512-GuZ4Ps0Zs0Vorhb1B90roUcLZ1NwHacnyCowVu4N7YWGpshq7x7sUJEWW6sOcxj6dAMfr8AXwiPcAht99Tm/iA==",
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEUCIBnXT1Fl8Oh+pOxA4hPXjgNWuy6ka8uEmLPwkpmpHMSXAiEA4JiW3K18npKsOAOv/FkvY7Nrnhne7Y67f0LjsRZgaew="
    }
  ]
}

Repository

PENDING
mojule/1tree-factory

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 18:39 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:5f6dd2cd196454cfacc403de9eddfde4b05c014831889cf02baadd03fb522a00

Other collected versions

0.1.159 Mar0.1.1416 Feb0.1.138 Feb0.1.127 Feb0.1.1125 Jan0.1.1025 JanView all collected versions →