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

new-struct

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

new-struct - npm Package Compare versions

Comparing version 0.0.0 to 0.0.1-security

28

package.json
{
"name": "new-struct",
"version": "0.0.0",
"description": "Structs inspired from Golang",
"version": "0.0.1-security",
"description": "",
"main": "index.js",
"scripts": {
"test": "fox"
"test": "echo \"Error: no test specified\" && exit 1"
},
"devDependencies": {
"fox": "*"
},
"keywords": [
"struct",
"golang"
],
"repository": {
"url": "git@github.com:azer\/new-struct.git",
"type": "git"
"type": "git",
"url": "git+https://github.com/npm/security-holder.git"
},
"author": "Azer Ko\u00e7ulu <azer@kodfabrik.com>",
"license": "BSD"
}
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/npm/security-holder/issues"
},
"homepage": "https://github.com/npm/security-holder#readme"
}

@@ -1,66 +0,9 @@

## new-struct
# Security holding package
Structs inspred from Golang
This package name is not currently in use, but was formerly occupied
by a popular package. To avoid malicious use, npm is hanging on to
the package name, but loosely, and we'll probably give it to you if
you want it.
```js
newStruct = require('new-struct')
Animal = newStruct({
name: '',
type: '',
age: 0,
run: run
})
function run (animal) {
console.log('%s is running', animal.name)
}
dongdong = Animal('dongdong', 'cat', 4)
blackbear = Animal('blackbear', 'cat', 3)
dongdong.run()
// => dongdong is running
blackbear.run()
// => blackbear is running
```
## Install
```bash
$ npm install new-struct
```
## Usage
You can pass the values as an object, too;
```js
dongdong = Animal({ type: 'cat', foobar: 'dfjh' })
```
Methods can also be defined later;
```js
Animal.method('jump', function(animal){
console.log('%s is jumping!!', animal.name)
})
```
To extend an existing struct:
```js
Cat = Animal.extend({
type: 'cat',
grrr: grrr
})
function grrr(cat) {
console.log('grrrrrr')
}
dongdong = Cat('dongdong', 2) // notice how 'type' property got eleminated from parameter order.
```
![](http://i.cloudup.com/CZR70W5Sct.png)
You may adopt this package by contacting support@npmjs.com and
requesting the name.
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