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

accp

v1.3.3

Published

The code is generated automatically by referring to the pattern file.

Downloads

155

Readme

Auto Create Code with Pattern files

Built to automatically create API codes or documents using concise code. You can change the code to what you want by using the pattern.

Installation

npm install accp -g

Visual Code Extension

Visual Code Extension Program accp language

Open the file with the extension( .api, .code, .struct ).

Enter the ctrl + k m (change language mode ) command.

Select Accp and apply it.

Example

accp --examples <folder>

An example file is created within the <folder>. Example project used a Swift pattern.

The folder structure is as follows.

api : Default document defining API( .api ).

code : Error Code Definition and Translation( .code ).

struct : Structure used in API( .struct ).

pattern : Custom pattern files( .js ).

*** All files and folders are required.**

Compile

accp --compile

Compile progresses with reference to pattern file. Compilation results are returned to OBJ and GEN.

module.exports = function( OBJ, GEN ) { 
    
  /* Please write your code */ 
}

The following code shall be included in the pattern/*.js file.

Compile result

Return value

GEN

GEN is a function that helps you create files.

initialization
var api = new GEN( "file path" )
method

api.open( encoding ) : Create write stream, default encoding utf8.

api.print( string ) : Write the content.

api.close() : Close write stream.

OBJ

Object created through accp --compile.

OBJ = {

  API: [ ( CLASS ) {
  
      BASE: String,
      NAME: String,
      MARK: String,
      FUNC: [ ( FUNC ) {
          
          CODE: Int,
          NAME: String,
          DESC: String
      
          /* Request method: address */
          ( GET | PUT | POST | PATCH | DELETE ): String
      
          /* Completion status */
          COMP: ( true | false )
      
          /* Associative process */
          PROC: [ {
            
              CODE: Int ( CLASS.FUNC.CODE ),
              NAME: String ( CLASS.FUNC.NAME )
          }, ... ],
          
          /* Comments about this function */
          MARK: [ {
              
              NAME: String,
              MARK: String
          }, ... ],
          
          REQ: [ ( DATA ) {
              
              NAME: String,
              MARK: String,
              CLASS: String,
              ARRAY: ( true | false ),
              OPTION: {

                  key: String,
                  key: String, ...
              }
          }, ... ],
          
          /* Be the same as REQ */
          RES: [ { ... } ],
          
          /* User defined value */
          OPT: {
            
              key: ( true | false ),
              key: ( true | false ), ...
          }
      }, ... ]
  }, ... ],
  
  CODE: [ ( CLASS ) {
    
      NAME: String,
      MARK: String,
      CODE: [ {

          CODE: Int,
          NAME: String,
          MARK: {
              
              key: String,
              key: String, ...
          }
      } ],
  }, ... ],
    
  STRUCT: [ {
              
      NAME: String,
      MARK: String,
      
      /* Be the same as REQ.DATA */
      DATA: [ { ... } ]
  }, ... ]
}

Language

accp language is provided as a visual code extension program.

.api

Usage prefix

api : Snippet for api.

api class : Snippet for api class.

api function : Snippet for api function.

.code

Usage prefix

code : Snippet for code.

code class : Snippet for code class.

code function : Snippet for code function.

.struct

Usage prefix

struct : Snippet for struct.

struct function : Snippet for struct function.

Raw data provided

Int

Data

Float

Double

String

Boolean

Change Log

1.0.4-beta : Replace sample files.

1.0.5-beta : Usage prefix explain add.

1.0.6-beta : Homepage domain change.

1.0.7-beta : Change to compile based on each api file.

1.0.8-beta : Solving a problem in which request partial detail information is truncated to spacing.

1.0.9-beta : Fixed an issue where the COMP value was unconditionally true.

1.2.1-beta : Addition of the PUT, PATCH, DELETE request method ( Consequently, it supports GET | PUT | POST | PATCH | DELETE ).

1.2.2-beta : Fixed a bug that would not output if 'import' was used in the variable name.

1.2.3-beta : Add sample pattern file (Flutter, Node JS).

1.3.0-beta : Modified main library & example pattern code. / Added Angular example pattern file. / When creating a file with new Gen(path), if there is no path corresponding to path, a folder is created.

1.3.3 : Modified Angular & NodeJS sample file and fixed issue with false value not being applied to OPT parameter.

License

MIT

Other programs

https://bettep.org