Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
A command line tool to create new JavaScript projects.
The main goal is to create a standard JavaScript project structure. Creating a JavaScript project is a lot of times filled with impedances on which tools to use and how to structure a project. In this way, jspg is an attempt to remove these impedances. Moving from project to project will be easier as well. You will learning the code and not how to run the project. Customization within the contraints of the project is a goal here as well. For example, if you want to use a different linter, install it and update the lint
npm script definition. That way the tool changes, but the use of a linter in your project does not. Using a different tool should not have to alter the way you interact with your project.
The main inspiration is ember-cli. I think the Ember team has done an excellent job on defining a consistent project structure and default tooling. I think the same experience should be brought to all JavaScript projects.
npm install -g jspg
jspg <app_name>
- Creates a new JavaScript project. This is used for either creating a node or JavaScript library project
jspg <app_name> -w
- Creates a new JavaScript web project. This is used for defining a frontend project
Designed so that you can write your code and tests in ES2015 JavaScript. jsx
is allowed as well.
This project by default uses standard, popular tools for:
es2015
and react
presetsProjects use npm to run scripts above:
npm run lint
: runs linternpm run build
: runs buildernpm run dev
: In web projects this runs development server. For library projects, this watches for changes and runs testsnpm run clean
: cleans build foldernpm run test
: runs testsnpm run docs
: runs documentation generatorThese are the defaults. If one wanted to change the tool used, the idea would be to:
This allows for the commands to stay consistent, but the functionality to change.
The structure of projects is defined below:
app/
- The src folder. This is where you would write your codeapp/app.js
- The entry point to your application.app/<app_name>
- This would be where all of your other code would go.tests/
- The test folder. All of your tests would go heretests/app-test.js
- An example test for app/app.js
.babelrc
- The babel configuration file.gitignore
package.json
- The project's package.json. This is also where the above npm scripts are defined.build/
- Build ends up here when npm run build
is executed. The files here would be what should be served or used for productiondocs/
- Documentation ends up here when npm run docs
is executedLibrary projects include the following:
webpack.config.js
- The webpack configurationWeb projects include the following:
app/index.html
- The starting html pageapp/<app_name>/styles.css
- The styles for your applicationwebpack.config.base.js
- The base webpack configuration. This is used to share configuration between dev and prod buildswebpack.config.dev.js
- The development webpack configuration. This includes a development server and hot code reload functionalitywebpack.config.prod.js
- The production webpack configurationFAQs
JavaScript project generator
We found that jspg demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.