# private-access

> Automatic private symbol creator.

Latest version **1.0.1** (published 2016-07-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install private-access
pnpm add private-access
yarn add private-access
bun add private-access
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2016-07-13 |
| First published | 2016-07-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Tyler Williams |
| Maintainers | tyler.williams.it |
| Keywords | private, classes, accessor |

## Links

- npm: https://www.npmjs.com/package/private-access
- Repository: https://github.com/tylerbwilliams/private-access
- Homepage: https://github.com/tylerbwilliams/private-access#readme
- Issues: https://github.com/tylerbwilliams/private-access/issues
- npm.io page: https://npm.io/package/private-access

## Recent versions

- 1.0.1 (latest) — 2016-07-13
- 1.0.0 — 2016-07-13

## README

# private-access

Automatic private symbol creator.

## Installation

`npm install --save private-access`

## Usage

**NOTE** This only works in ES6-compatible environments.

Include in any module that you want to have private access variables.  Doing a one-line include / call can reduce the setup to almost none:

```
const _ = require('private-access').create();
```

Once a private access variable has been created, you can just use the dot-operator to create new Symbols:

**person.js**
```
// Try in the Node.JS REPL! ( Node v6.x.x )

const _ = require('private-access').create();

class Person {
	
	constructor( name, ssn ) {
		this.name = name;
		this[_.ssn] = ssn;
	}
	
	speak() {
		console.log('I like food!');
	}
	
	[_.whisper]() {
		console.log('...waaayyy too much.');
	}
}
```

**index.js**
```
// No access to `ssn` value or `whisper` method:

const Person = require('./person');
const person = new Person('John Doe', '123-12-1234');

console.log(`Hi, my name is ${person.name}`);

person.speak();

```

## Contributing

1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D

## License

MIT. Because.

---
_Source: https://npm.io/package/private-access · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
