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

Publish on npm? #158

Open
BenjaminAster opened this issue Jan 21, 2024 · 1 comment
Open

Publish on npm? #158

BenjaminAster opened this issue Jan 21, 2024 · 1 comment

Comments

@BenjaminAster
Copy link

Nothing about this package is Deno-specific. Node.js currently can't run it because of TypeScript and .ts file imports, but Bun for example can (I tried it out). It would be awesome if this package would be published to npm, which would be as simple as:

  • creating a package.json file looking something like this:
    {
    	"name": "awesome-dom-parser-or-whatever",
    	"version": "0.1.43",
    	"main": "./deno-dom-wasm.ts",
    	"type": "module",
    	"author": "b-fuze",
    	"license": "MIT",
    	"files": [
    		"./*.ts",
    		"./src/**",
    		"./build/deno-wasm/**"
    	],
    	"repository": {
    		"type": "git",
    		"url": "git+https://github.com/b-fuze/deno-dom.git"
    	},
    	"bugs": {
    		"url": "https://github.com/b-fuze/deno-dom/issues"
    	},
    	"homepage": "https://github.com/b-fuze/deno-dom#readme"
    }
  • either deleting the build/deno-wasm/.gitignore file or adding a build/deno-wasm/.npmignore file with
    !*
    as its content.
  • running npm publish --access public
@EmNudge
Copy link

EmNudge commented Jan 24, 2024

You should be able to use this package in bun (not fully tested) through a direct github install.

pnpm i github:b-fuze/deno-dom

And use it as you would in deno, minus the url

import {
  DOMParser,
  Element,
} from "deno-dom/deno-dom-wasm.ts";

There's no version pinning, but this package wasn't meant to work in Node/Bun anyway and creating an npm release may introduce future maintenance burden.

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