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

Create a website #50

Closed
styfle opened this issue Dec 27, 2017 · 10 comments
Closed

Create a website #50

styfle opened this issue Dec 27, 2017 · 10 comments

Comments

@styfle
Copy link

styfle commented Dec 27, 2017

Have you thought about creating a website so that someone could link to the report to show the cost of a module?

For example, bundlephobia shows you the webpack size if you included the module. See Example.

It would be great to do something like cost-of-modules.com/result?p=ava@0.24.0 and see that the result is 24 MB.

@siddharthkp
Copy link
Owner

It probably doesn't fit in this repo but a related parallel project

What are the numbers that you'd like to show?

  1. download size
  2. ?

@styfle
Copy link
Author

styfle commented Dec 28, 2017

It probably doesn't fit in this repo but a related parallel project

I created pastelsky/bundlephobia#40 which might be a good place to put this feature if it is not out of scope.

What are the numbers that you'd like to show?

I think the numbers should show the size on disk.
The way I normally do this myself is the following:

mkdir ava-example
cd ava-example
npm init -y
npm install --save ava
du -sh

This prints 24 M

Note, I add the suffix -example to avoid the name collision with the package name.

@siddharthkp
Copy link
Owner

I was going to say something similar: pastelsky/bundlephobia#40 (comment)

the motive of bundlephobia is different but it has all of the code and infra required for this, maybe a fork makes the most sense 😄

@styfle
Copy link
Author

styfle commented Mar 20, 2018

@siddharthkp I would like to import this package and use it on the server but it doesn't seem to work.

npm install --save cost-of-modules
var com = require('cost-of-modules');
Error: Cannot find module 'cost-of-modules'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)

I thought it might be because of a missing main but I see that in package.json but I realize now that that the problem is caused by index.js not exporting anything.

@styfle
Copy link
Author

styfle commented Mar 20, 2018

I started work in this repo if anyone is interested in following:

https://github.com/styfle/packagephobia

@siddharthkp
Copy link
Owner

Oh yeah, it's because it assumes CLI

You can pull the functionality into a function and export that, should work

@styfle
Copy link
Author

styfle commented Mar 20, 2018

@siddharthkp I think that it would require quite a bit of refactoring to cost-of-modules to make the product I want.

The way cost-of-modules works is assuming you have cloned a repo and you are reading all of the installed dependencies.

The tool I want to build is more like bundlephobia in that you get the cost/size via the web interface, before you install anything.

So I think I'm going to develop this as a separate project and think of a different name. Unless you would like to collaborate and share the same name.

@styfle
Copy link
Author

styfle commented Apr 8, 2018

Here's what I came up with: https://github.com/styfle/packagephobia

@siddharthkp
Copy link
Owner

This is so cool!

@styfle
Copy link
Author

styfle commented Apr 9, 2018

Thanks for the kind words!

Keep up the great work on cost-of-modules, it's an excellent tool! 👍

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