{"id":46905617,"url":"https://github.com/connected-web/promise-path","last_synced_at":"2026-03-11T01:10:10.803Z","repository":{"id":3318251,"uuid":"49056286","full_name":"connected-web/promise-path","owner":"connected-web","description":"Promise based path operations, such as read, write, find, fetch, and clean.","archived":false,"fork":false,"pushed_at":"2023-07-18T21:36:50.000Z","size":529,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-14T16:41:02.667Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/connected-web.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-01-05T09:36:26.000Z","updated_at":"2022-03-19T16:30:04.000Z","dependencies_parsed_at":"2024-06-21T19:15:15.054Z","dependency_job_id":null,"html_url":"https://github.com/connected-web/promise-path","commit_stats":{"total_commits":67,"total_committers":6,"mean_commits":"11.166666666666666","dds":0.4626865671641791,"last_synced_commit":"2dce449d52a44bd2d619732aad1cfba841d56aad"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/connected-web/promise-path","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connected-web%2Fpromise-path","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connected-web%2Fpromise-path/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connected-web%2Fpromise-path/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connected-web%2Fpromise-path/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/connected-web","download_url":"https://codeload.github.com/connected-web/promise-path/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connected-web%2Fpromise-path/sbom","scorecard":{"id":302625,"data":{"date":"2025-08-11","repo":{"name":"github.com/connected-web/promise-path","commit":"74b225c394a5729a0fc9140e141e4c14718a3039"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.2,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/21 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pr-check.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/connected-web/promise-path/pr-check.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pr-check.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/connected-web/promise-path/pr-check.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/pr-check.yml:22","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/pr-check.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 15 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"11 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T21:06:57.855Z","repository_id":3318251,"created_at":"2025-08-17T21:06:57.855Z","updated_at":"2025-08-17T21:06:57.855Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30365050,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T21:41:54.280Z","status":"ssl_error","status_checked_at":"2026-03-10T21:40:59.357Z","response_time":106,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-03-11T01:10:10.382Z","updated_at":"2026-03-11T01:10:10.781Z","avatar_url":"https://github.com/connected-web.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Promise Path\nA collection of promise based path operations including `read`, `write`, `find`, `fetch`, `make`, `clean`, `position`, and `run`.\n\nQuick start:\n```\nnpm install promise-path\n```\nThen pick the features you need:\n```\nconst { read, write, find, fetch, make, clean, position, run } = require('promise-path')\n```\n\n## API\nThe API currently supports the following methods `read`, `write`, `find`, `fetch`, `make`, `clean`, `position`, and `run` as follows:\n\n### Read\nRead the contents of a file, and return the result as a promise.\n\n```js\nconst { read } = require('promise-path')\n\nlet promise = (async () =\u003e {\n  const readme = await read('README.md', 'utf8')\n  console.log('Readme file:', readme)\n\n  const json = JSON.parse(await read('package.json'))\n  console.log(JSON.stringify(json, null, '  '))\n})()\n```\n\n### Write\nWrite contents to a file, and return a promise.\n\n```js\nconst { write } = require('promise-path')\n\nlet promise = (async () =\u003e {\n  const log = ['message 1', 'message 2', 'message 3']\n  const file = 'output.log'\n  await write(file, log.join('\\n'))\n  console.log('Contents written to', file)\n})()\n\n```\n\n### Find\nFind files that match a pattern, and return a promise.\n\n```js\nconst { find } = require('promise-path')\n\nlet promise = (async () =\u003e {\n  const filepaths = await find('./lib/**/*.js')\n  console.log('JS files:', filepaths)\n})()\n```\n\n### Fetch\nRetrieve a remote file, and return a promise.\n\n```js\nconst { fetch } = require('promise-path')\n\nlet promise = (async () =\u003e {\n  const fileContents = await fetch('https://raw.githubusercontent.com/connected-web/remote-test/master/info.json')\n  console.log('Remote file:', fileContents)\n})()\n```\n\n```js\nconst { fetch } = require('promise-path')\n\nlet promise = (async () =\u003e {\n  const GITHUB_PERSONAL_ACCESS_TOKEN = process.argv[1] || ''\n  const apiContents = await fetch({\n    url: 'https://api.github.com/repos/connected-web/promise-path/contents/readme',\n    headers: {\n      'Authorization': `token ${GITHUB_PERSONAL_ACCESS_TOKEN}`,\n      'Accept': 'application/vnd.github.v3.raw',\n      'User-Agent': `My App - node ${process.version}`\n    }\n  })\n  console.log('Remote file:', apiContents)\n})()\n```\n\n### Clean\nRemove local files and folders, and return a promise.\n\n```js\nconst { clean } = require('promise-path')\nconst path = require('path')\n\nlet promise = (async () =\u003e {\n  await clean(path.join(__dirname, '/temp'))\n  console.log('Temp directory has been removed')\n})\n```\n\n### Make\nUse `mkdirp` to make a directory, and return a promise.\n\n```js\nconst { make } = require('promise-path')\nconst path = require('path')\n\nlet promise = (async () =\u003e {\n  await make(path.join(__dirname, '/temp'))\n  console.log('Temp directory has been created')\n})()\n```\n\n### Position\nCreate a function that helps you position new paths relative to a base path:\n```js\nconst { position } = require('promise-path')(__dirname, '../data')\nconst filepath = position('item-list.json')\nconsole.log('Avoids having to use path.join directly:', filepath)\n```\n\n### Run\nUse `child_process.exec` to run a command, and return a promise.\n\n```js\nconst  { run } = require('promise-path')\n\nlet promise = (async () =\u003e {\n  try {\n    const result = await run('cat package.json')\n    console.log('Error', result.error)\n    console.log('Exit code', result.exitCode)\n    console.log('Std out', result.stdout)\n    console.log('Std err', result.stderr)\n  }\n  catch(ex) {\n    console.error(ex)\n  }\n})()\n```\n\nWith a current working directory (cwd), and custom environment variables (env):\n\n```js\nconst { run } = require('promise-path')\n\nlet promise = (async () =\u003e {\n  const cwd = process.cwd()\n  const env = {HOME: process.cwd()}\n  try {\n    const result = await run('npm install', cwd, env)\n    console.log('Error', result.error)\n    console.log('Exit code', result.exitCode)\n    console.log('Std out', result.stdout)\n    console.log('Std err', result.stderr)\n  }\n  catch(ex) {\n    console.error(ex)\n  }\n})()\n```\n\n## Dependencies\n- denodeify\n- glob\n- fs-extra\n- request\n\n## Development\nCheckout the code, then:\n\n```\nnpm install\nnpm test\n```\n\n## Changelog\n\n### 1.4.4\n- Merge dependabot patch bumping json5 from 1.0.1 to 1.0.2\n\n### 1.4.3\n- Update package dependencies to latest versions\n\n### 1.4.2\n- Update package dependencies to latest versions\n\n### 1.4.0\n- Remove dependency the `denodeify` package\n\n### 1.3.1\n- Update package dependencies to latest versions\n\n### 1.3.0\n- Add `position` command to create a path friendly helper function\n- Update `examples.js` and fix typos in README.md\n\n### 1.2.7\n- Rewrite all tests and examples using async await style\n- Add `examples.js` file to harness worked examples in README.md\n\n### 1.2.6\n- Support quoted spaces in commands\n- e.g. `git commit -m \"Some message with spaces\"`\n\n### 1.2.4\n- Updated node dependencies\n- Added example for fetching data from the github API with headers\n\n### 1.2.3\n- Updated node dependencies\n- Changed run to use `process.env.comspec` on windows, to reduce `ENOENT` errors\n\n### 1.2.2\n- Added `make` command\n\n### 1.2.1\n- Added `env` : environment variables as option to `run`\n\n### 1.2.0\n- Added `cwd` as a second optional parameter to `run`\n\n### 1.1.1\n- Reworked `run` command to use `child_process.spawn`\n- Added `exitCode` to the return object on `run`\n\n### 1.1.0\n- Added method with test: `run`\n\n### 1.0.0\n- Initial release\n- Supported methods: `read`, `write`, `find`, `fetch`, `clean`\n- Created tests\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconnected-web%2Fpromise-path","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconnected-web%2Fpromise-path","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconnected-web%2Fpromise-path/lists"}