Permalink
Browse files

added npm ignore file, updated package.json and updated readme file

  • Loading branch information...
1 parent 2d5c8a1 commit e1f1736bf6e7825934352a3160d8e1739aea2c92 @vizio360 committed Mar 28, 2013
Showing with 33 additions and 9 deletions.
  1. +2 −0 .npmignore
  2. +11 −3 README.md
  3. +20 −6 package.json
View
@@ -0,0 +1,2 @@
+.git
+.gitignore
View
@@ -36,9 +36,6 @@ Each mapping has a unique id that you define.
From different modules you can query the *injector* to give you a new instance of a specific mapping.
Within classes you can define depenecies which will be satisfied on creation of a new instance of that class.
-
-
-
# API
## Let's start with an example
```coffeescript
@@ -64,6 +61,17 @@ instance.sayYeah() # this print "YEAH!" to the console
CoffeeInjector = require "coffeeInjector"
Injector = new CoffeeInjector()
```
+Every Injector will automatically create a mapping to itself as a Singleton called "Injector".
+This is useful if you want to get hold of the injector from witin a class, by just pecifying it in the list of the injetion points.
+```coffeescript
+CoffeeInjector = require "coffeeInjector"
+Injector = new CoffeeInjector()
+
+class MyClass
+ inject:
+ injector: "Injector"
+```
+Every new instance of MyClass ( created through Injector.getInstanceOf) will have a property called injector which holds the reference to the Injector that created the class.
## `.map( mappingObject )`
### Map a module knowing the path
View
@@ -1,21 +1,35 @@
{
- "name": "nodeInjector",
+ "name": "coffee-injector",
"version": "0.0.1",
- "description": "ERROR: No README.md file found!",
+ "description": "Small and simple utility component that you can use in your applications to ease the management of dependencies between objects.
+The idea is simple, you have a factory object (we'll call this the *injector*) where you define some mappings.
+Each mapping has a unique id that you define.
+From different modules you can query the *injector* to give you a new instance of a specific mapping.
+Within classes you can define depenecies which will be satisfied on creation of a new instance of that class.",
"main": "index.js",
"directories": {
+ "lib": "lib",
"test": "test"
},
"scripts": {
"test": "jasmine-node --test-dir test --coffee",
"prepublish": "coffee -bco lib src"
},
"devDependencies": {
- "jasmine-node": ">=1.4.0",
- "coffee-script": ">=1.6.0"
+ "jasmine-node": ">=1.4.0",
+ "coffee-script": ">=1.6.0"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/vizio360/coffeeInjector.git"
},
- "repository": "",
"author": "Simone Vicentini (@vizio360)",
"license": "BSD",
- "gitHead": "7950255063a3ddf5360f48e1cd03a612dddecd86"
+ "gitHead": "7950255063a3ddf5360f48e1cd03a612dddecd86",
+ "readmeFilename": "README.md",
+ "keywords": [
+ "coffeescript",
+ "ioc",
+ "dependency injection"
+ ]
}

0 comments on commit e1f1736

Please sign in to comment.