Comparing version 1.0.1 to 2.0.0
{ | ||
"name": "runme", | ||
"version": "1.0.1", | ||
"main": "index.js", | ||
"bin": { | ||
"runme": "index.js" | ||
"version": "2.0.0", | ||
"author": "Christian Bromann <christian@stateful.com>", | ||
"license": "Apache-2.0", | ||
"description": "A JavaScript module to use Runme in Node.js", | ||
"homepage": "https://github.com/stateful/runmejs#readme", | ||
"bin": "./bin/runme.js", | ||
"type": "module", | ||
"main": "./dist/cjs/index.js", | ||
"module": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"exports": { | ||
".": [ | ||
{ | ||
"types": "./dist/index.d.ts", | ||
"import": "./dist/index.js", | ||
"require": "./dist/cjs/index.js" | ||
}, | ||
"./cjs/index.js" | ||
] | ||
}, | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"author": "", | ||
"license": "ISC", | ||
"description": "Run a code section in a README.md", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/KoryNunn/runme.git" | ||
"url": "git+https://github.com/stateful/runmejs.git" | ||
}, | ||
"keywords": [ | ||
"runme" | ||
], | ||
"bugs": { | ||
"url": "https://github.com/KoryNunn/runme/issues" | ||
"url": "https://github.com/stateful/runmejs/issues" | ||
}, | ||
"homepage": "https://github.com/KoryNunn/runme" | ||
"scripts": { | ||
"build": "run-s clean compile copy", | ||
"clean": "rimraf dist", | ||
"compile": "tsc -p ./tsconfig.json", | ||
"copy": "cp src/cjs/package.json dist/cjs/package.json", | ||
"postinstall": "node ./postInstall.js", | ||
"release": "release-it --github.release --ci --npm.skipChecks --no-git.requireCleanWorkingDir", | ||
"test": "run-s test:*", | ||
"test:nodejs": "vitest --config ./vitest.config.ts", | ||
"test:cjs": "ts-node tests/cjs/cjs.test.ts", | ||
"watch": "npm run compile -- --watch" | ||
}, | ||
"devDependencies": { | ||
"@octokit/rest": "^19.0.7", | ||
"@types/node": "^18.15.11", | ||
"@types/tar-fs": "^2.0.1", | ||
"@types/wait-on": "^5.3.1", | ||
"@vitest/coverage-c8": "^0.30.1", | ||
"c8": "^7.13.0", | ||
"npm-run-all": "^4.1.5", | ||
"release-it": "^15.10.1", | ||
"rimraf": "^5.0.0", | ||
"ts-node": "^10.9.1", | ||
"typescript": "^5.0.4", | ||
"vitest": "^0.30.1" | ||
}, | ||
"dependencies": { | ||
"@actions/exec": "^1.1.1", | ||
"get-port": "^6.1.2", | ||
"node-fetch": "^3.3.1", | ||
"tar-fs": "^2.1.1", | ||
"wait-on": "^7.0.1" | ||
} | ||
} |
@@ -1,26 +0,76 @@ | ||
# RUNME | ||
# Runme.js [![Test Changes](https://github.com/stateful/runmejs/actions/workflows/test.yaml/badge.svg)](https://github.com/stateful/runmejs/actions/workflows/test.yaml) [![npm version](https://badge.fury.io/js/runme.svg)](https://badge.fury.io/js/runme) [![Join us on Discord](https://img.shields.io/discord/878764303052865537?color=5b39df&label=Join%20us%20on%20Discord)](https://discord.com/invite/BQm8zRCBUY) | ||
Run a code section in a README.md | ||
> A JavaScript module to use [Runme](https://runme.dev) in Node.js. | ||
## Usage | ||
_Runme.js_ contains the the [Runme CLI](https://github.com/stateful/runme) and allows to access its functionality through a simple JavaScript interface. The CLI binary is downloaded and cached when the interface is first being used. | ||
In a console, run: | ||
## Install | ||
### Node.js | ||
Install the module through NPM: | ||
```sh | ||
$ npm install runme | ||
# or Yarn | ||
$ yarn add runme | ||
``` | ||
runme README.md 1 | ||
You can also install the package globally and it as a CLI, e.g.: | ||
```sh | ||
npm i -g runme | ||
runme list | ||
``` | ||
where the second code section (section 1) has something like this: | ||
By default this package downloads the [Runme CLI](https://github.com/stateful/runme) when the interface is used for the first time. You can download it after running `npm install` by setting the `RUNME_DOWNLOAD_ON_INSTALL` environment flag. You can also modify the Runme version that is being installed by setting `RUNME_VERSION`, e.g.: | ||
```sh | ||
RUNME_DOWNLOAD_ON_INSTALL=1 RUNME_VERSION=1.0.0 npm install runme | ||
npx runme --version | ||
``` | ||
console.log('hello world'); | ||
## Usage | ||
The module exposes the following methods: | ||
### `run` | ||
Run code cells from markdown files: | ||
```ts { name="runExample" } | ||
import { run } from 'runme' | ||
const result = await run( | ||
'.examples/example.md', | ||
{ id: 'helloWorld' } | ||
) | ||
console.log(result) // outputs: { exitCode: 0, stdout: 'Hello World\r\n', stderr: '' } | ||
``` | ||
which will run the above code. | ||
Similar you can run `runSeries` and `runParallel` if you like to run multiple cells. | ||
Or you can 'name' your sections like so: | ||
### `createServer` | ||
named | ||
Start a Runme execution session: | ||
```ts | ||
import { createServer, run } from 'runme' | ||
const server = await createServer() | ||
// execute `export FOO="bar"` from markdown code cell with id "export" | ||
await run('.examples/example.md', { id: 'export', server }) | ||
// execute `echo "exported FOO=$FOO"` from markdown code cell with id "print" | ||
const result = await run('.examples/example.md', { id: 'print', server }) | ||
console.log(result) // outputs: { exitCode: 0, stdout: 'exported FOO=bar\r\n', stderr: '' } | ||
``` | ||
console.log('named section') | ||
``` | ||
--- | ||
<p align="center"> | ||
<small> | ||
Copyright 2023 © <a href="http://stateful.com/">Stateful</a> – Apache 2.0 License | ||
</small> | ||
</p> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 4 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
45935
26
396
0
0
77
Yes
5
12
1
5
2
+ Added@actions/exec@^1.1.1
+ Addedget-port@^6.1.2
+ Addednode-fetch@^3.3.1
+ Addedtar-fs@^2.1.1
+ Addedwait-on@^7.0.1
+ Added@actions/exec@1.1.1(transitive)
+ Added@actions/io@1.1.3(transitive)
+ Added@hapi/hoek@9.3.0(transitive)
+ Added@hapi/topo@5.1.0(transitive)
+ Added@sideway/address@4.1.5(transitive)
+ Added@sideway/formula@3.0.1(transitive)
+ Added@sideway/pinpoint@2.0.0(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedaxios@1.7.9(transitive)
+ Addedbase64-js@1.5.1(transitive)
+ Addedbl@4.1.0(transitive)
+ Addedbuffer@5.7.1(transitive)
+ Addedchownr@1.1.4(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addeddata-uri-to-buffer@4.0.1(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addedend-of-stream@1.4.4(transitive)
+ Addedfetch-blob@3.2.0(transitive)
+ Addedfollow-redirects@1.15.9(transitive)
+ Addedform-data@4.0.1(transitive)
+ Addedformdata-polyfill@4.0.10(transitive)
+ Addedfs-constants@1.0.0(transitive)
+ Addedget-port@6.1.2(transitive)
+ Addedieee754@1.2.1(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedjoi@17.13.3(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedmkdirp-classic@0.5.3(transitive)
+ Addednode-domexception@1.0.0(transitive)
+ Addednode-fetch@3.3.2(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedproxy-from-env@1.1.0(transitive)
+ Addedpump@3.0.2(transitive)
+ Addedreadable-stream@3.6.2(transitive)
+ Addedrxjs@7.8.1(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedstring_decoder@1.3.0(transitive)
+ Addedtar-fs@2.1.1(transitive)
+ Addedtar-stream@2.2.0(transitive)
+ Addedtslib@2.8.1(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedwait-on@7.2.0(transitive)
+ Addedweb-streams-polyfill@3.3.3(transitive)
+ Addedwrappy@1.0.2(transitive)