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

Can this lib be published to npm as well ? #26

Closed
riderx opened this issue Feb 6, 2024 · 6 comments
Closed

Can this lib be published to npm as well ? #26

riderx opened this issue Feb 6, 2024 · 6 comments

Comments

@riderx
Copy link

riderx commented Feb 6, 2024

I use this lib in deno function and wanted to use the same in node code and it's not available, but if i just copy the code it work so i suppose you could publish it as well

@bradenmacdonald
Copy link
Owner

How does it work if you "just copy the code"? Node doesn't support TypeScript, so it's necessary to use a tool like dnt before Node can run it, unless you already have TypeScript/webpack/etc set up in your project.

I could set up dnt and publish to npm, but I don't have a strong motivation to do this. The minio client is already available on NPM and is what this one is based on, so it has similar features.

@riderx
Copy link
Author

riderx commented Feb 13, 2024

Thanks @bradenmacdonald, for your answer, I explored a few options and your lib was the best one over and over, any platform compared, Node.js Deno, and Cloudflare worker.
My code was in TS as well, and For Node.js I have a build step to convert the code.
That why I was able to test your code on all platforms, and it worked like a charm.
Minio require some significant changes to do so, AWS SDK is too big and other alternatives are not maintained, too complex or not good quality. I spent days trying another way, but all brought me back to your lib.

So I made the Pr and the required changes to allow you to deploy in NPM if you like; otherwise I published my Fork, but I would prefer to keep one source of truth.

@bradenmacdonald
Copy link
Owner

Closing this for now. I'm not going to publish on npm but it can be used with npm (and many others) via JSR: https://jsr.io/@bradenmacdonald/s3-lite-client#installation

@riderx
Copy link
Author

riderx commented Aug 27, 2024

Thanks @bradenmacdonald i'm using it but the typescript is missing i'm not sure it's from you i found this :
jsr-io/jsr#216

@bradenmacdonald
Copy link
Owner

@riderx The types are working just fine for me. Try this:

mkdir test-project
cd test-project
echo '{"type": "module"}' > package.json
npm install --save typescript
npx jsr add @bradenmacdonald/s3-lite-client
echo 'import { S3Client } from "@bradenmacdonald/s3-lite-client";' > test.ts
echo '{"compilerOptions": {"module": "ESNext", "moduleResolution": "Bundler", "lib": ["ESNext", "DOM"], "strict": true}}' > tsconfig.json
npx tsc

No output means the type checking worked.

Here you can see the types showing up in VS Code in that same NodeJS project:
Screenshot

@riderx
Copy link
Author

riderx commented Oct 6, 2024

"module": "ESNext", "moduleResolution": "Bundler" did the trick !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants