Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOCS] libnpmhook examples are outdated #5558

Open
2 tasks done
mt-empty opened this issue Sep 22, 2022 · 0 comments
Open
2 tasks done

[DOCS] libnpmhook examples are outdated #5558

mt-empty opened this issue Sep 22, 2022 · 0 comments
Labels
Documentation documentation related issue Priority 2 secondary priority issue ws:libnpmhook Related to the libnpmhook workspace

Comments

@mt-empty
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

This is a CLI Docs Problem, not another kind of Docs Problem.

  • This is a CLI Docs Problem.

Description of Problem

I'm trying to use libnpmhook. It says to use token when querying but that doesn't work because it has been renamed to authToken

I tried a simple ls query using authToken and npm automation token, but I still get unauthorized!

const hooks = require('libnpmhook')
export async function listNPMHooks(token: string) {
	const response = await hooks.ls({
		authToken: token
		})
	return response
}
  headers: [Object: null prototype] {
    date: [ 'Thu, 22 Sep 2022 02:50:08 GMT' ],
    'transfer-encoding': [ 'chunked' ],
    connection: [ 'keep-alive' ],
    'cf-ray': [ ffffffffffffffffff-MARS' ],
    'cf-cache-status': [ 'DYNAMIC' ],
    vary: [ 'Accept-Encoding' ],
    server: [ 'cloudflare' ],
    'x-fetch-attempts': [ '1' ]
  },
  statusCode: 401,
  code: 'E401',
  method: 'GET',
  uri: 'https://registry.npmjs.org/-/npm/v1/hooks',
  body: Buffer(0) [Uint8Array] [],
  pkgid: undefined
}

Any help?

Potential Solution

No response

Affected URL

https://github.com/npm/cli/tree/latest/workspaces/libnpmhook

@mt-empty mt-empty added Documentation documentation related issue Needs Triage needs review for next steps labels Sep 22, 2022
@fritzy fritzy added Priority 2 secondary priority issue ws:libnpmhook Related to the libnpmhook workspace and removed Needs Triage needs review for next steps labels Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation documentation related issue Priority 2 secondary priority issue ws:libnpmhook Related to the libnpmhook workspace
Projects
None yet
Development

No branches or pull requests

2 participants