Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nature

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nature - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

1

lib/thing.js

@@ -456,3 +456,2 @@ // module dependencies

}

@@ -459,0 +458,0 @@ return result;

2

package.json
{
"name": "nature",
"version": "0.0.1",
"version": "0.0.2",
"description": "A library to help classify the things (models) in your world (app) and how they interact.",

@@ -5,0 +5,0 @@ "main": "lib/nature.js",

@@ -1,2 +0,2 @@

** under construction **
***library under construction***

@@ -11,30 +11,30 @@ Nature

Enables you to write API methods like: (`YoungMan` and `FlammableCar` are derivitives of `Thing`)
exports.burnCar = function(arsonist){
var youngMan = new YoungMan(arsonist);
if (!youngMan.valid){
throw new Error(youngMan.validationMessages.join("\n"));
// throws:
// The arsonist supplied must be a young man.
// Invalid age 29: Must be between 11 and 19.
// Over 5 litres Gasoline required
// Less compassion necessary.
} else {
var car = new FlammableCar(process.env);
if (car.valid){
// the Vauxhall Astra supplied in the environment is indeed flammable
youngMan.igniteCar(car);
}
```javascript
exports.burnCar = function(arsonist){
var youngMan = new YoungMan(arsonist);
if (!youngMan.valid){
throw new Error(youngMan.validationMessages.join("\n"));
// throws:
// The arsonist supplied must be a young man.
// Invalid age 29: Must be between 11 and 19.
// Over 5 litres Gasoline required
// Less compassion necessary.
} else {
var car = new FlammableCar(process.env);
if (car.valid){
// the Vauxhall Astra supplied in the environment is indeed flammable
youngMan.igniteCar(car);
}
}
}
```
Client code for the above is straight forward, input taken directly from the command line
var outdoors = require("outdoor-activity");
outdoors.burnCar(process.argv);
```javascript
var outdoors = require("outdoor-activity");
outdoors.burnCar(process.argv);
```
Then a simple command executes the outdoor activity:
$ CAR_MAKE=Vauxhall CAR_MODEL=Astra node outdoors.js --name Alfie --age 11 --litres 13 --compassion unknown
```sh
$ CAR_MAKE=Vauxhall CAR_MODEL=Astra node outdoors.js --name Alfie --age 11 --litres 13 --compassion unknown
```
See the Thing docs for more detail..
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc