Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
<a href="https://github.com/constructive-io/decryption/blob/main/LICENSE">
<img height="20" src="https://img.shields.io/badge/license-MIT-blue.svg">
</a>
<a href="https://www.npmjs.com/package/decryption">
<img height="20" src="https://img.shields.io/npm/v/decryption.svg" alt="decryption on npm">
</a>
</p>

Dependency-light building blocks for mnemonics, envelope encryption, Shamir secret sharing and team
Expand All @@ -21,6 +24,16 @@ Constructive endpoint you name.
The primitives have been audited upstream; the formats and tools built on them here have not. See
[Audit status](#audit-status) for exactly where that line is.

## Install

```bash
npm install -g decryption
dcrypt --help
```

That installs the `dcrypt` command. To try it without installing, run `npx decryption --help`. For the
libraries, install the scoped packages below, e.g. `npm install @decryption/core`.

## Packages

| Package | npm | Source | Description |
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/__tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ describe('main', () => {

it('is what the decryption package runs', () => {
const wrapper = readFileSync(join(__dirname, '../../decryption/index.js'), 'utf8');
expect(wrapper).toContain("require('@decryption/cli').main()");
expect(wrapper).toContain("require('@decryption/cli')");
expect(wrapper).toContain('cli.main()');
});
});
13 changes: 10 additions & 3 deletions packages/decryption/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!/usr/bin/env node
// `npm install -g decryption` installs the `dcrypt` command from @decryption/cli.
// This package holds no code of its own; it runs the CLI at the exact version it depends on.
require('@decryption/cli').main();
// `decryption` is the entry point: `npm install -g decryption` installs the `dcrypt` command, and
// `require('decryption')` gives you the @decryption/cli API. This package holds no code of its own;
// it runs the CLI at the exact version it depends on.
const cli = require('@decryption/cli');

if (require.main === module) {
cli.main();
} else {
module.exports = cli;
}
Loading