npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

extrain

v1.4.1

Published

A simple Express.js scaffold.

Downloads

16

Readme

ExTrain

ExTrain is a tool for quickly building front-end projects based on Express.js.

Installation

npm install -g extran

Usage

extran dev

Development mode

In development mode, ExTrain starts a local server, compiles and packages your code in real-time. Any changes to files will automatically trigger recompilation and packaging, and updates will be displayed in the browser in real-time.

Build mode

extran build

In build mode, ExTrain optimizes, compresses and packages your code, generating final deployable code. The packaged code will be placed in a directory named .output.

ETN mode(can't be used now)

extran etn [pageName]

In ETN mode, ExTrain compiles and packages the specified page, generating the corresponding ETN file. ETN (Entity-Template-Node) is a data exchange format used to build distributed web applications.

Configuration file

ExTrain supports configuration via the extrain.config.js file. In this file, you can specify allowed file types to be scanned, exclude files that do not need to be compiled and packaged, and other relevant configuration items.

extrain.config.js:
module.exports = { lang: 'en', main: 'bin/www' }

the configuration file descriptionn:

| Configuration Item | Default Value | Type | Description | | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | lang | 'en' | string | Language(en,de,cn,tw,jp) | | main | 'bin/www' | string | Project entry | | useProgress | true | boolean | Whether to use progress bar | | progressColor | 'cyan' | string | Progress bar color | | progressOptions | { barCompleteChar: '\u2588', barIncompleteChar: '\u2591', barsize: 30, hideCursor: true } | object | Configuration options for the progress bar | | cdnPath | '//farm.google.com/' | string | Your CDN path. In your CSS, EJS, and JS files, you should use "{@cdnPath/your-image-url}" to represent the static resource address of your image or other files. For example, if your image is located at "/foo/bar.jpg", it should be written as "url({@cdnPath/foo/bar.jpg})" in your CSS file. After extrain build, it will become "//farm.google.com/(md5).png". | | devDir | '.dist' | string | Dev mode output file path | | buildDir | '.output' | string | Build output file path | | usePx2Rem | true | boolean | Whether to change px to rem | | usePx2RemOptions | { rootValue: 40, propList: ['*'] } | object | Options for px to rem | | useEtn | false | boolean | Whether to use etn mode (currently cannot be used) | | usePages | false | boolean | Whether to use pages mode (currently cannot be used) | | expressPathes | { routes: 'routes', views: 'views', public: 'public' } | object | Express directory configuration for generating corresponding files with pages | | excludeList | [ '.git', '.dist', '.output', 'backup', 'node_modules', 'README.md', 'api.http', 'logs', 'webpack.config.js', 'extrain.config.js', /^./, /^yarn/ ] | array | Filter file/directory list | | publicBundler | 'rollup' | string | use for .js in public dir, 'rollup' or 'browserify'. (If false, all JS files will be directly compressed through Uglify without module processing.) | | publicDir | 'public' | string | Rollup directory (when useRollup is true, js files in this directory will be packaged with Rollup,Commonly used for client-side scripts) | | publicDirSource | 'source' | string | In dev mode, the source files under publicDir will be copied to publicDir/publicDirSource after the build process. | | rollupOptions | {output:{format:'umd'},nodeResolve:{},commonjs:{},babel:{babelHelpers:'bundled'},tenser:{format:{comments:false}}} | object | Rollup configuration options (rollup out config, and plugins options) | | publicExclude | [] | array | Exclude file or directory in publicDir, but will not to be output.(filename or directory name or regex) | | browserSyncOptions | {proxy:'http://localhost:3000',files:[devDir],port:3001,open:false,notify:true,ui:false,logPrefix:'BS'} | object | the configuration options for browserSync, used to configure the auto-reloading service.use env.PORT change proxy port | | uglifyOptions | { compress: { booleans: true, drop_console: false, collapse_vars: true, hoist_vars: true, if_return: true } } | object | Uglify configuration options | | useTemplteEngine | 'ejs' | string | The name of the template engine (currently only supports ejs) |

Author

GhostBlessU

License

MIT